ODBC Error on OpenReport

the_utmost

Registered User.
Local time
Today, 07:39
Joined
Mar 10, 2005
Messages
40
Hi:

I have a query that is the recordsource for a report. The query uses linked Oracle tables. I get the error:
Error Number 3146: ODBC--call failed.
[Oracle][ODBC][Ora]ORA-00936: missing expression
(#936)

whenever I use this command:
DoCmd.OpenReport (my report name), acViewNormal

I have reset all the timeouts from 60 secs to 0. It seems that is usually the cause but that didn't help me. Any idea's?
 
Last edited:
Resolved

This was an interesting one. I have my reports prewritten with a recordsource hardcoded into them. But the queries are dynamic and need to be linked (again) in my VBA code like so:

Set qry = CurrentDb.QueryDefs("qrySharedPassThrough")
qry.SQL = strSQL

I have dynamically created the strSQL string and the qrySharedPassThrough is a generic query that drives every report. Got it working by setting the querydef!!
 

Users who are viewing this thread

Back
Top Bottom