I am trying to establish a connection from an Excel workbook to an Oracle DB both to insert data and to extract data. I have had this type of cnnection working before, but to SQL Server. Unlike a previous post, I do not get a Runtime error 91 when opening the connection, but when I try to set the ActiveConnection (highlighted in the code below).
I have tried both the "msdaora" and "OraOLEDB.Oracle" as the provider, but neither resolves the problem. I have the ActiveX Data Objects 2.8 Library installed as well.
Relevant code fragment is as follows (note the parameters to the connection string are passed into this routine):
Can anyone give guidance on the problem?
Thanks
I have tried both the "msdaora" and "OraOLEDB.Oracle" as the provider, but neither resolves the problem. I have the ActiveX Data Objects 2.8 Library installed as well.
Relevant code fragment is as follows (note the parameters to the connection string are passed into this routine):
Rich (BB code):
dim dboCn as ADODB.Connection
dim dboCmd as ADODB.Command
dim dboParams as ADODB.Parameters
dim strConnectString as string
strConnectString = "Provider=msdaora;Data Source=" & strDBName _
& ";User Id=" & strUserId & ";Password=" & strPassword
set dboCn = new ADODB.Connection
dboCn.Open (strConnectString)
if dboCn is Nothing then exit sub
set dboCmd.ActiveConnection = dboCn
set dboParams = dboCmd.Parameters
Can anyone give guidance on the problem?
Thanks