shacho
asked on
Access Asking for Connection Parameters with Passthrough Query
I have created a link to a MySQL table in an Access DB.
I can run regular queries on the link with no problem.
If I try to run a passthrough query on it, however, Access asks me to select the data source (even though the connection parameters are stored in the link).
I'm not sure why and I don't think this is expected behavior for Access.
Can someone help me troubleshoot?
Mike
I can run regular queries on the link with no problem.
If I try to run a passthrough query on it, however, Access asks me to select the data source (even though the connection parameters are stored in the link).
I'm not sure why and I don't think this is expected behavior for Access.
Can someone help me troubleshoot?
Mike
ASKER
Yes - it can be done this way. But if I do it that way, then it is not referencing the linked table. I could delete the link and the passthrough would still work. In fact, this is what I'm doing now. I expected that Access would use the linked table to make the connection, but I guess Access doesn't look at the query contents at all if it's a passthrough. If so, then the behavior is expected.
Pass-through queries are just that, they pass the query (or any valid SQL) from Access directly to you MySQL database, where the SQL is processed. This requires the connection string because, as Gustav indicated, the query does not know anything about the tables involved. I generally get the connection string by typing the following in the immediate window:
?Currentdb.Tabledefs("Some LinkedTabl eName").Co nnect
I then paste this into the connection string in the Pass-Through query. Don't forget to set the queries ReturnsRecords to the the appropriate value (Yes or No).
?Currentdb.Tabledefs("Some
I then paste this into the connection string in the Pass-Through query. Don't forget to set the queries ReturnsRecords to the the appropriate value (Yes or No).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Makes sense. Thanks Gustav!
Mike
Mike
ASKER
Dale - sorry - I didn't see your post until now. If you request a point reallocation, I'll do so.
you're good. Gustav answered the question, I just piled on with a bit of additional info.
ASKER
OK! Thanks again.
The property ODBCconnection has to hold a string starting with ODBC; as here:
ODBC;Driver=YourMySqlDrive
You can open one of your linked tables in design view and study the properties. You can probably copy and paste the full connection string from this to your query.
/gustav