SQL Pass-through Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to be able to reference a connection included in a module funcion
through the "ODBC Connection Str" property found in the properties window of
a "SQL Pass-Through Query".

Any ideas if this is possible, and if yes, how can I do this?

Any suggestions would be appreciated.

Thanks.
 
To get a pass-through query connection string you can use following syntax:

debug.print currentdb.querydefs("MyQuery").Connect
 
Thank you for your response Alex. I think I wasn't very clear describing my
problem, let me try to rephrase it.

Ultimately I want to connect to an Oracle database, for some reason the DSN
connection is failing but works when I do this with DSN less connection using
ADO.

So I want the SQL-Pass through connectstr to reference the ADO connection
included in a module. Make sense?

Thanks again for your response.
 
The sample to which Alex pointed you doesn't actually explicitly spell it
out, but all you need to specify for the connection string is the
appropriate ODBC DSN-less string. Check what Carl Prothman has at
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm The
"secret" is that you must precede the connection string with ODBC;

Note that you cannot use an Ole DB connection string: Access will only
recognize the ODCB one.
 
Back
Top