Connect to MySQL in QTP and edit the vbs script as follows: DimConnSetConnCreateObject (& quot; ADODB. connection & quot;) & #39; ConstConnectionString & quot; DSNtest; DATABASEchen; PWDroot; PORT3306; SERVERlocalhost; UIDroot & quot; ConstConnectionString & quot; Driver {MysqlODBC5.1Driver mysqlqtp database
Connect to MySQL in QTP and edit the vbs script as follows:
Dim Conn
Set Conn = CreateObject ("ADODB. Connection ")
'Const ConnectionString = "DSN = test; DATABASE = chen; PWD = root; PORT = 3306; SERVER = localhost; UID = root"
Const ConnectionString = "Driver = {Mysql ODBC 5.1 Driver}; DATABASE = chen; PWD = 111111; PORT = 3306; SERVER = localhost; UID = root"
Conn. Open ConnectionString
If Conn. State <> 0 Then
Reporter. ReportEvent micPass, "testing", "database connected"
Else
Reporter. ReportEvent micFail, "testing", "database connection failed"
End If
Always error: [Microsoft] [ODBC driver manager] no data source name found and default driver not specified
Line (5): "Conn. Open ConnectionString ".. What is the reason?