SQL Pass-through Query

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.
 
A

Alex Dybenko

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

debug.print currentdb.querydefs("MyQuery").Connect
 
G

Guest

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.
 
D

Douglas J. Steele

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top