sql server connection error "Provider cannot be found. It may not be properly installed."
Hi,
I am trying to connect to the sql server db using TestComplete 11, but I am getting an error: "Provider cannot be found. It may not be properly installed."
Below is the code I am using, please let me know how can I fix it.
AConnection = ADO.CreateADOConnection();
// Specify the connection string
AConnection.ConnectionString = "Provider=System.Data.SqlClient;"+
"data source=192.168.202.40\mssqlserver01,1724;initial catalog=K212.HrPayroll.ThamesValley.Hina;persist security info=True;user id=sql.server;password=sql.server";
// Suppress the login dialog box
AConnection.LoginPrompt = false;
AConnection.Open();
// Execute a simple query
RecSet = AConnection.Execute_("SELECT * FROM EC_GROUP WHERE EMP_GROUP_CODE = 'ADMIN1'");
// Iterate through query results and insert data into the test log
RecSet.MoveFirst();
while(! RecSet.EOF)
{
Log.Message(RecSet.Fields.Item("EC_GROUP").Value, RecSet.Fields.Item("EMP_GROUP_CODE").Value);
RecSet.MoveNext();
}
AConnection.Close();
}
Thanks,
Hina