K
KSH
I have the following union query that worked when the customers files were in
dbase III and the program was in Access97(did not have to use ODBC). They
recently upgraded the files to Visual Foxpro and I upgraded my Access program
to 2000. Now when I use this query I get an ODBC fail error. I know it is
on the UNION ALL section because I can eliminate that part and the query
runs. But I can open the SoyTrn03 table no problem, so I know I am linked
correctly.
Any advice would be appreciated. Not sure if the problem is with the Access
upgrade or the Foxpro
SELECT SOTRAN03.ITEM, SOTRAN03.PRICE, SOTRAN03.CLASS, SOTRAN03.ORDATE,
SOTRAN03.QTYSHP, SOTRAN03.DISC, SOTRAN03.SONO, SOTRAN03.SALESMN,
SOTRAN03.QTYORD, SOTRAN03.CURRENT
FROM SOTRAN03
WHERE (((SOTRAN03.ITEM)="MISC") AND ((SOTRAN03.PRICE)>0) AND
((SOTRAN03.ORDATE) Between [Forms]![ReportMenu]![fromdate] And
[Forms]![ReportMenu]![todate]) AND ((SOTRAN03.CURRENT) Is Null)) OR
(((SOTRAN03.PRICE)>0) AND ((SOTRAN03.CLASS)=" 1" Or (SOTRAN03.CLASS)=" 2")
AND ((SOTRAN03.ORDATE) Between [Forms]![ReportMenu]![fromdate] And
[Forms]![ReportMenu]![todate]) AND ((SOTRAN03.CURRENT) Is Null))
UNION ALL SELECT SOyTRN03.ITEM, SOyTRN03.PRICE, SOyTRN03.CLASS,
SOyTRN03.ORDATE, SOyTRN03.QTYSHP, SOyTRN03.DISC, SOyTRN03.SONO,
SOyTRN03.SALESMN, SOyTRN03.QTYORD, SOyTRN03.CURRENT
FROM SOyTRN03
WHERE (((SOyTRN03.ITEM)="MISC") AND ((SOyTRN03.PRICE)>0) AND
((SOyTRN03.ORDATE) Between [Forms]![ReportMenu]![fromdate] And
[Forms]![ReportMenu]![todate])) OR (((SOyTRN03.PRICE)>0) AND
((SOyTRN03.CLASS)=" 1" Or (SOyTRN03.CLASS)=" 2") AND ((SOyTRN03.ORDATE)
Between [Forms]![ReportMenu]![fromdate] And [Forms]![ReportMenu]![todate]));
dbase III and the program was in Access97(did not have to use ODBC). They
recently upgraded the files to Visual Foxpro and I upgraded my Access program
to 2000. Now when I use this query I get an ODBC fail error. I know it is
on the UNION ALL section because I can eliminate that part and the query
runs. But I can open the SoyTrn03 table no problem, so I know I am linked
correctly.
Any advice would be appreciated. Not sure if the problem is with the Access
upgrade or the Foxpro
SELECT SOTRAN03.ITEM, SOTRAN03.PRICE, SOTRAN03.CLASS, SOTRAN03.ORDATE,
SOTRAN03.QTYSHP, SOTRAN03.DISC, SOTRAN03.SONO, SOTRAN03.SALESMN,
SOTRAN03.QTYORD, SOTRAN03.CURRENT
FROM SOTRAN03
WHERE (((SOTRAN03.ITEM)="MISC") AND ((SOTRAN03.PRICE)>0) AND
((SOTRAN03.ORDATE) Between [Forms]![ReportMenu]![fromdate] And
[Forms]![ReportMenu]![todate]) AND ((SOTRAN03.CURRENT) Is Null)) OR
(((SOTRAN03.PRICE)>0) AND ((SOTRAN03.CLASS)=" 1" Or (SOTRAN03.CLASS)=" 2")
AND ((SOTRAN03.ORDATE) Between [Forms]![ReportMenu]![fromdate] And
[Forms]![ReportMenu]![todate]) AND ((SOTRAN03.CURRENT) Is Null))
UNION ALL SELECT SOyTRN03.ITEM, SOyTRN03.PRICE, SOyTRN03.CLASS,
SOyTRN03.ORDATE, SOyTRN03.QTYSHP, SOyTRN03.DISC, SOyTRN03.SONO,
SOyTRN03.SALESMN, SOyTRN03.QTYORD, SOyTRN03.CURRENT
FROM SOyTRN03
WHERE (((SOyTRN03.ITEM)="MISC") AND ((SOyTRN03.PRICE)>0) AND
((SOyTRN03.ORDATE) Between [Forms]![ReportMenu]![fromdate] And
[Forms]![ReportMenu]![todate])) OR (((SOyTRN03.PRICE)>0) AND
((SOyTRN03.CLASS)=" 1" Or (SOyTRN03.CLASS)=" 2") AND ((SOyTRN03.ORDATE)
Between [Forms]![ReportMenu]![fromdate] And [Forms]![ReportMenu]![todate]));