sql - VBA query a MySQL database -


i'm getting crazy right now. found posts in here it's not working me...

what i'm trying have piece of vba code in excel can make query in database select * blabla

i'm having problems getting connection! seems examples found bit older. i'm using mysql 5.7.

i appreciate lot if can give me easy example our post online tutorial how that. because found code no explanation! if have little bit context code great! because don't have idea vba or making connection mysql databse :

set cn = new adodb.connection     cn.open "driver={mysql odbc 5.3 unicode driver};server=" & server_name & ";database=" & database_name & _     ";uid=" & user_id & ";pwd=" & password & ";" 

for example (one thing found).

this whole code found

 ' carl sql server connection  '  ' code work  ' in vbe need go tools references , check microsoft active x data objects 2.x library  '     dim server_name string     dim database_name string     dim user_id string     dim password string     dim sqlstr string      server_name = "localhost" ' enter server name here     database_name = "tap" ' enter database name here     user_id = "bla" ' enter user id here     password = "blabla" ' enter password here      sqlstr = "select * result" ' enter sql here      set cn = new adodb.connection     cn.open "driver={mysql odbc 5.3 unicode driver};server=" & server_name & ";database=" & database_name & _     ";uid=" & user_id & ";pwd=" & password & ";" 

but hell odbc or why using 5.3? want understand know need use

thanks


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

Laravel mail error `Swift_TransportException in StreamBuffer.php line 269: Connection could not be established with host smtp.gmail.com [ #0]` -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -