WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

ADO DAO
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

OLE Exception Connecting to Oracle ODBC Driver


Question:

I'm finally taking the ADO plunge after seeing how much less code is involved than there is for ODBC...

Here's the sample code:

uid='user'
pwd='pwd'
cConn = "Driver=(Oracle ODBC Driver);SERVER='dss1prd';uid='%uid%';pwd='%pwd%'"
db = ObjectOpen('ADODB.Connection')
db.open(cConn)
;do stuff here...
db.Close()
ObjectClose(db)

I am getting the error message:

OLE Exception:
Microsoft OLE DB Provider for ODBC Drivers
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.
It seems to me that it's not picking up the correct driver name, but I'm not really sure where to go. Oh yes, I'm attempting to access an Oracle server, WB 2003E, Win2k...

Any suggestions greatly appreciated

Answer:

The driver name 'Oracle ODBC Driver' should always be enclosed in { }, not ( )

The following article states it should look something like this(notice the use of curly braces):

DRIVER={Microsoft ODBC for Oracle};SERVER=path to server
Please see:
http://msdn.microsoft.com/library/en-us/iisref/htm/AccessingDatawithADO.asp?frame=true
Article ID:   W16082
File Created: 2004:03:30:15:42:46
Last Updated: 2004:03:30:15:42:46