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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC Error when converting from Access 97 to 2003

Status
Not open for further replies.

kihunterk

IS-IT--Management
Apr 5, 2005
11
US
I currently have an Access 97 application that uses an ODBC connection to extract data out of an external database. The application uses a reference to a form to designate the search key. In Access 97 this program works flawlessly.

I recently began the process of converting the application to Access 2003. When I execute the query I get the following error:

ODBC: Called error

My SQL state:

SELECT value_set.ky_value_set, value_set.ky_value_set_id, value_set.tv_low_values, value_set.tv_range_of_values, value_set.tv_value FROM value_set WHERE (((value_set.ky_value_set)=[vset]));


The error occurs any time I use a variable in the WHERE statement. It does not occur when I use a value.


Any assistance would be greatly appreciated.
 
are you sure [vset] is valid?

is it a parameter or fieldName?

if it's a parameter, make sure the parameter is set properly, if it's a fieldName then I can't see in the sql you posted, the field it's referencing...

--------------------
Procrastinate Now!
 
[Vset] is a control on a form. The person providing me the copy of the SQL statement did not enter the correct syntax for a form variable.
 
WHERE value_set.ky_value_set=[Forms]![name of open mainform]![vset];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Even with the correct identifier (control) the query still creates "ODBC call failed" error. The only time the extract works via ODBC is when you replace the variable with a literal value.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top