AKarandjeff
14 years agoContributor
Oracle ADO Connection String
I am trying to connect to an Oracle 11g database in TestComplete using the ADO components and am hitting an error on Open that states "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". I have set up an ODBC connection (in attachment) and it tests successfully. When you lok at the driver name, it says "Oracle in OraClient11g_home1," so that is what I've been using for the Driver variable in the connection string. I've tried a variety of connection string types based on using ADO in other applications, but none seem to work. One example is below. I'm also including my TNSNAMES entry for the database. I have tried the IP address for the host, as well as the host name itself. Thanks.
var AConnection, RecSet;
// Create a Connection object
AConnection = ADO.CreateADOConnection();
// Specify the connection string
AConnection.ConnectionString = "Driver={Oracle in OraClient11g_home1};dbq=bluff:1521/DEVC11G;UId=user;Pwd=password;";
// Suppress the login dialog box
AConnection.LoginPrompt = false;
AConnection.Open();
DEVC11G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = bluff)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEVC11G)
)
var AConnection, RecSet;
// Create a Connection object
AConnection = ADO.CreateADOConnection();
// Specify the connection string
AConnection.ConnectionString = "Driver={Oracle in OraClient11g_home1};dbq=bluff:1521/DEVC11G;UId=user;Pwd=password;";
// Suppress the login dialog box
AConnection.LoginPrompt = false;
AConnection.Open();
DEVC11G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = bluff)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DEVC11G)
)