MySQL Forums
Forum List  »  Microsoft Access

Re: How to use MS Access pass through query with MySQL
Posted by: banglore agent1
Date: September 10, 2009 06:20PM

I got this to work to MySQL. I'm sure SQL Server is similar.

First, I had make a query with no parameters in Access that connected to MySQL and returned results. Then I made a form in Access, set the query as the Record Source, and set the Form format to Datasheet.
After you set the Record Source in design mode, a list of column names comes up. Drag them and place them somewhere on the form, doesn't really matter where for a datasheet.
Then go back to the Form's properties and blank out the Record Source.

then right click on the form, Build Event, Code and paste this in there.

the important thing is the connection string property
you use it to open a connection (duh)
then execute a query which returns a set of records,
then tell the form to use that recordset to populate its datasheet

then when the form is unloaded from memory, you grab the connection and close it
-------------------------------
Games Online
Website Appraisal



Edited 1 time(s). Last edit at 09/10/2009 06:20PM by banglore agent1.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: How to use MS Access pass through query with MySQL
5045
September 10, 2009 06:20PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.