Forum Discussion

mikex3215's avatar
mikex3215
Occasional Contributor
9 years ago

Is mysql supported by testcomplete?

I been trying to connect to mysql database on my localhost to test its connection

but unfortunately it always fails.

 

does testcomplete supports mysql?

1 Reply

  • sbkeenan's avatar
    sbkeenan
    Frequent Contributor

    Hi MikeX3215

     

    Yes, mySQL is supported by TestComplete - I use it all the time.  I think you might just have a problem with your connection string.

     

    Because I need to connect to different databases, I have a getConnString routine that builds the connection string.  In that routine, I use the following:

     

    connString =  "Driver={MySQL ODBC 5.1 Driver};" +
    	                    "server=" + serverIP + ";" +
    	                    "User=" + userID + ";" +
    	                    "Password=" + password + ";" +
    	                    "Option=3;";

     

    Where I need to connect to the database, I use something like:

     

    connection = ADO.CreateConnection();
    		connection.ConnectionString = MyUtilities.getConnString();
    		connection.Open();
    		cmd = ADO.CreateCommand();
    		cmd.ActiveConnection = connection;	
    		
    		cmd.CommandText = "<SQL Query Here>";
    		cmd.CommandType = adCmdText;
    		rs = cmd.Execute();

     

    It hasn't failed me yet!

     

    Hope this points you in the right direction.

     

    Regards

    Stephen.