ACCESS to MYSQL Pass-Through Query

How can i create a dynamic pass-through query in MYSQL?

do i need to adjust my connection string?
ODBC;UID=root;PWD=test;DSN=localhost
LVL 1
CMDAIAsked:
Who is Participating?
 
TextReportCommented:
A Pass Through Query is not updateable. Your ODBC setting in the pass through query would be

ODBC;DATABASE=jnbkcrop;DESCRIPTION=JNBKCorpLocalHost;DSN=JNBKCorpLocalHost;OPTION=0;PORT=0;SERVER=localhost

The SQL in the pass through query is not interpreted / converted and is "PASSED THROUGH" as is to the server to run so the select below has to be in MySQL syntax rather than MSACCESS / JET syntax.

SELECT ID, Title FROM jnbkcrop.inventory

Cheers, Andrew
0
 
TextReportCommented:
I assume you are in Access creating a Pass Through query in there. Yes you can. The easiest way to get your ODBC connect string is to attach a table and then look at the Description property in the Access table design, the ODBC connect string is everything excep the TableNam at the end.

As far as the Dynamic bit then you may need to expand. You can not include parameters as everything in the Pass Through Query has to be Server related but you could modify the SQL in code.

Cheers, Andrew
0
 
CMDAIAuthor Commented:
For the first part i got it,
but im not so sure what u mean "the Pass Through Query has to be Server related"

I copied this from the linked "inventory table"
ODBC;DATABASE=jnbkcrop;DESCRIPTION=JNBKCorpLocalHost;DSN=JNBKCorpLocalHost;OPTION=0;PORT=0;SERVER=localhost;;TABLE=inventory

SQL:
SELECT ID, Title FROM jnbkcrop.inventory;

I get "Recordset is not updatable"
0
 
CMDAIAuthor Commented:
ahh, ok.
I was very much off on the meaning of passtrough q.
Thank's
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.