Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying ODBC linked tables won't work when promting for parameters

Status
Not open for further replies.

tabtech

IS-IT--Management
May 22, 2003
17
US
Hello to all!

Any help with the following issue will be greately appreciated.

I am querying two tables in Access 2002 that are linked via file ODBC to a Pervasive 7.0 database. A range of invoice numbers is what I need to pull and the query works fine when my selection criteria in the invoice field reads:

Between "INV0099985" And "INV0099999"

But, since I need the range of invoices to be entered by a user, when I change the selection criteria to:

Between [From Invoice:] And [To Invoice:]

After being prompted for the two values, I get an error:

ODBC - Call Failed

FYI here are the two SQL statements:

Works:
SELECT OEINVD.INVNUMBER, OEINVD.ITEM, OEINVD.QTYSHIPPED, OEINVD.INVUNIT, OEINVH.BILNAME, OEINVH.SHIPVIA FROM OEINVD INNER JOIN OEINVH ON OEINVD.INVNUMBER = OEINVH.INVNUMBER WHERE (((OEINVD.INVNUMBER) Between "INV0099985" And "INV0099999"))
ORDER BY OEINVD.INVNUMBER;

Does not work:
SELECT OEINVD.INVNUMBER, OEINVD.ITEM, OEINVD.QTYSHIPPED, OEINVD.INVUNIT, OEINVH.BILNAME, OEINVH.SHIPVIA FROM OEINVD INNER JOIN OEINVH ON OEINVD.INVNUMBER = OEINVH.INVNUMBER WHERE (((OEINVD.INVNUMBER) Between [From Invoice:] And [To Invoice:]))
ORDER BY OEINVD.INVNUMBER;

I have tried limiting the size of the data being queried by first writing a query that pulls all invoices greater than INV0099000 (we are currently up to just over INV0100000) and then querying that query with the above selection criteria but received the same ODBC error. The query ODBC Timeouts are set to zero.

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top