You have to install mysql odbc connector first.
Dim Connection, ConnectString ConnectString = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;PORT=3306;Database=database;User=root;Password=" Set Connection = CreateObject("ADODB.Connection") Connection.Open ConnectString Sql = "SELECT id,created_at FROM table ORDER BY id DESC LIMIT 0, 10" Set Result = Connection.Execute(Sql) Do Until Result.EOF Wscript.Echo "Id=" + CStr(Result(0)) + ",Create_Date=" & FormatDateTime(Result(1), 1) Result.MoveNext Loop Connection.Close
Can you let me know what is the connection string for ODBC Driver 8.0.15
ReplyDeleteConnectString = "Driver={MySQL ODBC 3.51 Driver};Server=localhost;PORT=3306;Database=database;User=root;Password="
Look at the drivers in your computers ODBC panel and use that name as is.
ReplyDelete