![]() ![]() 'Create a recordset and set the CursorLocation property for record navigation Sql = "SELECT * FROM my_table WHERE some_field_value='my_value' " "UID=your_login_name PWD=your_password OPTION=3" 'Connect to MySQL server using MySQL ODBC 3.51 DriverĬonn.ConnectionString = "DRIVER= " & _ Whatever you prefer, the general idea is exactly the same. I wrote the database fields and values to an Excel workbook but you might like to write it plain and simple to your word document, or insert it into a table. I can't test it from here but if you just want to read data from a MySQL database I imagine the routine would look something like the one below. MySQL has a sample VBA routine in their documentation. MySQL falls in the latter category so you best go with ADO. Maybe it's the same as to a *.mdb but I would like an example with all parameters etc I should use.Īs a rule of thumb you best use DAO for Jet Engine based databases (Like Access, Fox Pro etc) and ADO for other databases. I suppose it will also be possible to setup a connection using the OLEDB driver from Microsoft (MSDASQL) but I'd stick with the driver from the database manufacturer. I'm not sure if you installed it already but if not you can download the driver here: ![]() I want to make a connection to a sql-database with ODBC, and for that I need the code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |