mysql - Error in VBA:`[Microsoft][ODBC Manager] Data source name not found and no default driver specified -


I am creating macros to add data from my MySQL database

but when I use the macro I get an error to run:

[Microsoft] [ODBC manager] The name of the data source was not found and no specific driver specified

< Strong> code:

  sub-update MySQLDatabasePHP () 'ADODB.Connection Dim Server_Name string dim databases as http://www.vbaexcel.eu/ Dim Cn for detailed explanation Of In the form of string thumb as User_ID, string_demo ADODEB.Recordset set RS = new ADODB.Recordset Server_Name = Range ("e4") as string-DM password in the form of string substrate as stratrate. Value 'IP number or server name database_name = category ("E1"). Value 'name value' id user or user name password = range ("e3"). Value 'password table = range ("e2"). Range ("A6") offset (red, 0) to write the name of the value 'Red = 0'. Value & lt; & Gt; Tom Textstang = Tom Column = 0 Range ("A5") Offset (0, Column). Value & lt; & Gt; Tom If Column = 0 Then TextStrag = Textstring & amp; Cells (5, 1) & amp; "= '" & Amp; Cells (6 + rad, 1) if column & lt; & Gt; 0 then text = string = textstorage & amp; Cells (6 + rad, 1 + kollam) column = column + 1 vend textstorage = textstag & amp; "'"', '& amp; Amp; cells (5, 1 + kollam) & amp; "='" & Amp; Field 2 = "CID" field 1 = "bid" table 1 = "mmbner" sqlsrr = "update" & tabellen & "set" & textstring & amp; "WHERE" & cells (5, 1) & amp; "= '" & Amp; cells (6 + rad, 1) & amp; "'" CN = new AdodB.Connection Cn.Open "driver {{MySQL ODBC 3.51 driver}; Server = "& amp; Server_Name & amp; Database = "& Database_Name & amp; _"; Uid = "& amp; user_id & amp; Pwd = "& amp; Passwords & amp;", "Cn.Execute SQLStr rad = Raid + 1 Wend Set RS = No CN. Set CN = None End Sub    

It seems that there is something wrong with the connection string Do you have the mySQL odbc driver installed?

The easiest ways From I have found to test the connection to create a new text document "new text document .txt" and to rename the udl file extension so that you can add it Then open the file "New Text document.udl" and it will show you the Datalink proerties Wizard.You can go through the wizard to create and check the connection. To get the connection string, either ".udl" Open the file or change the extension back to ".txt" and open it from Notepad.

Comments