Receiving error message 'Microsoft OLE DB Provider for ODBC Drivers'
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2010
02:22 AM
01-20-2010
02:22 AM
Receiving error message 'Microsoft OLE DB Provider for ODBC Drivers'
Using the section of code below, I am receiving an error message stating:
---------------------------
TestComplete
---------------------------
An exception occurred in the "sc_Common_Functions" unit at line 966:
Microsoft OLE DB Provider for ODBC Drivers
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
---------------------------
OK
---------------------------
The code previously worked and now is no longer working. What could be my problem? Below is the section of code where the issue occurs. The error occurs on the line: aCon["Open"]();.
function ReadInSQLData(TableName, Col1, Row1, Col2)
{
//This function reads in one piece of data from a table based on
//data from another column. ???This may not work if a third row of
//data is required (if more than two lines have the same data).
var aCon, aCmd, aRecSet, iRow, iColumn, Row2;
var MainColumn, ColumnToChoose;
// Creates ADO connection
aCon = ADO["CreateConnection"]();
// Sets up the connection parameters
aCon["ConnectionString"] = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Automation; Database=" + SQL_MainDatabase;
// Opens the connection
aCon["Open"]();
// Creates a command and specifies its parameters
aCmd = ADO["CreateCommand"]();
aCmd["ActiveConnection"] = aCon; // Connection
aCmd["CommandType"] = adCmdTable; // Command type
aCmd["CommandText"] = TableName; // Table name
// Opens a recordset
aRecSet = aCmd["Execute"]();
aRecSet["MoveFirst"]();
...
Mike
P.S. The same code works fine on a different computer.
---------------------------
TestComplete
---------------------------
An exception occurred in the "sc_Common_Functions" unit at line 966:
Microsoft OLE DB Provider for ODBC Drivers
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
---------------------------
OK
---------------------------
The code previously worked and now is no longer working. What could be my problem? Below is the section of code where the issue occurs. The error occurs on the line: aCon["Open"]();.
function ReadInSQLData(TableName, Col1, Row1, Col2)
{
//This function reads in one piece of data from a table based on
//data from another column. ???This may not work if a third row of
//data is required (if more than two lines have the same data).
var aCon, aCmd, aRecSet, iRow, iColumn, Row2;
var MainColumn, ColumnToChoose;
// Creates ADO connection
aCon = ADO["CreateConnection"]();
// Sets up the connection parameters
aCon["ConnectionString"] = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Automation; Database=" + SQL_MainDatabase;
// Opens the connection
aCon["Open"]();
// Creates a command and specifies its parameters
aCmd = ADO["CreateCommand"]();
aCmd["ActiveConnection"] = aCon; // Connection
aCmd["CommandType"] = adCmdTable; // Command type
aCmd["CommandText"] = TableName; // Table name
// Opens a recordset
aRecSet = aCmd["Execute"]();
aRecSet["MoveFirst"]();
...
Mike
P.S. The same code works fine on a different computer.
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2010
03:44 AM
01-20-2010
03:44 AM
Our ODBC specialist worked with the code and found a workaround. We do not know why this works, but it does. According to the documentation the code is similar and should work the same. The line:
was changed to:
aCon["ConnectionString"] = "Provider=MSDASQL.1;Persist Security Info=False; Data Source=Automation; Database=" + SQL_MainDatabase;
was changed to:
aCon["ConnectionString"] = "Provider=sqloledb;Integrated Security=SSPI; Server=(local)\\P3Plus; Database=" + SQL_MainDatabase;
Why would Test Complete complain about the first line, but be okay with the second line?
Mike
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2010
04:09 AM
01-25-2010
04:09 AM
Hi,
According to the exception you get, the problem is in the provider you're using. Probably, the appropriate DB driver is either not installed or corrupt on the problematic machine.
According to the exception you get, the problem is in the provider you're using. Probably, the appropriate DB driver is either not installed or corrupt on the problematic machine.
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
