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
Post a Comment