ODBC Connection String

G

Guest

I wanted to include the OBDC connection string in my select query. In the
Query Properties, I've entered the connection string in the Source Connect
Str field, so my SQL now looks like this:

SELECT DISTINCT MCMCU, MCLDM
FROM PRODDTA_F0006 IN '' [ODBC;DSN=Harvest
Production;UID=SELECT_USER;PWD=xxxxxx;DBQ=AGJD1PDD];

When I run the query, I get an error message telling me the Jet database
engine cannot find the table or query PRODDTA_F0006. If I run the query
without the connection string, it prompts me for the password, and
everything runs fine. Is there any way to include the PW in the connection
string so I don't have to type it in every time?
 
M

MGFoster

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to the Access Help file you can only connect to Access (Jet
db) or dBase or Paradox external dbs this way. It doesn't say anything
about ODBC dbs.

If you want to run that SQL query, run it as an SQL Pass Throught (SPT)
query. Place the SQL string in a QueryDef SQL View (without the IN
phrase). On the menu select Query > SQL Specific > Pass Through. Then
put the IN phrase in the ODBC Connect Str property.
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQlre2YechKqOuFEgEQJcNACfcwrwHz1HeHKWMBFWWgCqh2sXbv0AoIaG
RPts0ZQgzteuFj34mcDG9cxu
=4ql4
-----END PGP SIGNATURE-----
 

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