I am using Visual studio 2008 and I need to write some code to write some data to a mysql database.
I can get this working in excel and have been doing this for some time, I cannot however get it working in Visual Studio.
The code I'm using is ...
Code: Select all
Dim conn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
conn.Open "UID=root;PWD=password;DATABASE=db;SERVER=localhost;DRIVER=MYSQL ODBC 5.1 DRIVER"
Set cmd.ActiveConnection = conn
rs.CursorLocation = adUseClient
cmd.CommandText = "INSERT INTO blah (blah2) VALUES (blah3)"
cmd.Execute
What am I doing wrong / missing ?
Thanks