Define OLEDB connection string

J

John

I am having trouble defining an OLEDB connection string to
an Oracle database. I have no problem using an ODBC
connection.

Works (ODBC)
obj.Connection = "ODBC;DRIVER={Microsoft ODBC for
Oracle};SERVER=IFAS;UID=scott;PWD=tiger"

Doesn't work (OLEDB)
obj.Connection = "OLEDB; Provider=MSDAORA; Data
Source=ifas; User ID=scott; Password=tiger;"

Does a DSN need to be created for OLEDB connections? What
am I missing? TIA...

John
 
J

Jamie Collins

Jake said:
You should be able to do it DSN-less. The connection string should be:

"Provider=msdaora;Data Source=MyOracleDB;" & _
"User Id=myUsername;Password=myPassword"

I seem to remember Oracle's own OLEDB provider being preferred to
Microsoft's version.

The OP can roll their own OLEDB connection string using the following:

Sub ShowConnString()
Dim oDLink As Object
Set oDLink = CreateObject("DataLinks")
On Error Resume Next
MsgBox oDLink.PromptNew
End Sub

Jamie.

--
 
J

Jake Marx

Jamie said:
I seem to remember Oracle's own OLEDB provider being preferred to
Microsoft's version.

Interesting - I remember hearing the opposite some time ago. But when I
google it now, I get conflicting results on which provider is better.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top