I am working on design for some custom interfaces, like garninshment detail for various vendors in their predescribed format. I am using C# .net and comparing ODBC vs. LawOledb access. Would like to use LawOledb for security setup, but I have trouble duplicating the database access string. I have listed below the ODBC that pulls from PAYDEDUCTN, EMPLOYEE and PREMPGARN. I cannot figure out how to do the same in LawOledb. I insert PREMPGARN.CASE-NUMBER and get an error.
Any help will be greatly appreciated. Let me know also if I am totally on the wrong path.
ODBC =
str_sql = @"SELECT PAYDEDUCTN.COMPANY, PAYDEDUCTN.EMPLOYEE, PAYDEDUCTN.CHECK_ID, PAYDEDUCTN.DED_CODE, PAYDEDUCTN.CHECK_DATE, PAYDEDUCTN.PER_END_DATE, PAYDEDUCTN.DED_AMT, PREMPGARN.CASE_NUMBER, PAYDEDUCTN.GARN_OBJ_ID, EMPLOYEE.LAST_NAME FROM PROD.dbo.PAYDEDUCTN PAYDEDUCTN INNER JOIN PROD.dbo.EMPLOYEE EMPLOYEE ON (PAYDEDUCTN.COMPANY=EMPLOYEE.COMPANY) AND (PAYDEDUCTN.EMPLOYEE=EMPLOYEE.EMPLOYEE) LEFT OUTER JOIN PROD.dbo.PREMPGARN PREMPGARN ON ((PAYDEDUCTN.COMPANY= PREMPGARN.COMPANY) AND (PAYDEDUCTN.GARN_OBJ_ID= PREMPGARN.GARN_OBJ_ID) AND (PAYDEDUCTN.EMPLOYEE= PREMPGARN.EMPLOYEE)) WHERE (PAYDEDUCTN.COMPANY='4321') AND ((PAYDEDUCTN.CHECK_DATE>={ts '" + fromDatets + @"'}) AND (PAYDEDUCTN.CHECK_DATE<={ts '" + toDatets + @"' })) AND (PAYDEDUCTN.DED_CODE='BCD1')";
LawOledb =
str_sql = @"dme:FILE=PAYDEDUCTN&FIELD=COMPANY;EMPLOYEE;EMPLOYEE.LAST-NAME;EMPLOYEE.FIRST-NAME;DED-CODE;DED-AMT;CHECK-DATE;PER-END-DATE&SELECT=COMPANY=4321%26DED-CODE=BCD1%26(CHECK-DATE%3E%3D" + fromDate + "%26CHECK-DATE%3C%3D" + toDate + ")";