Sandeep N Seshadri wrote:

Could you please tell me more about the pass through queries. i dont have an
idea abt it sandeep




Sure.

Create a new query in Access.

Instead of adding tables to the query design view like normal, simply click the 'query' menu, and select 'SQL Specific', and then 'Pass-through'.
The query builder window will disappear, and leave you with a plain text editor where you can enter the SQL. Remember not to put the usual garbage that Access puts around field names, ie [square brackets], as MySQL doesn't like them.


Then click the 'view' menu, and select 'Properties'. The 2nd field should be 'ODBC connection string'. Click inside this field, and a little builder icon ( ... ) appears to the side. Click the builder, and you should get your list of ODBC data sources. Select your data source for MySQL, and you're done. When you run the query, it will get passed straight to MySQL.

You can edit the SQL of the query later in VB if you have to, for example:

dim sql_string as string

sql_string = "select * from MyTable where ID=456 and thingy=3"
currentdb.querydefs("NameOfMyPassthroughQuery").sql = sql_string

The above code will update the SQL of your pass-through query, so when you open it next time, it will return the records you're after. Pretty cool, eh?

Dan


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to