views:

30

answers:

1

Hi
I have an MS Access 2003 frontend and mySQL backend.
I would like to automatically connect to MySQL when the MDB is opened for the first time, eg when the Main Menu form of Access is displayed.

However I have no idea and I keep getting the "annoying" MySQL "Connector ODBC" pop up box.
This happens when I go into a form in Access which has obviously fields "connected" to MySQL.

Any ideas how to do this?

Thanks !!!!

+2  A: 

There should be a checkbox called something like 'Remember password' when you create the linked tables using ODBC. Try recreating the links to the tables and making sure this is ticked. Access should start up knowing how to access the tables as if they were native.

(Works in Access 97)

Mat
forgot to mention (my mistake, sorry), I have different connection points (databases), so I would like to connect automatically based on a variable.... in other words, it is not always the same database connection
griseldas
Then I hope you like coding! You need to create a DSN using DBEngine.RegisterDatabase, which allows you to specify the server and database to use. You can then use this to create linked tables using DAO (you'll need to reference the DAO 3.6 object library) by setting up a TableDef for the required table and using CurrentDB.TableDefs.Append newTableDefThere is a good example in the WROX book "Access 2003 VBA Programmers Reference"
Mat
Hi Mat, thanks for info, yes I love coding, so I will get right into it...
griseldas