What connection string do I use for Classic ASP and Oracle 10g?

johnny picture johnny · Apr 25, 2011 · Viewed 10.8k times · Source

I have Oracle 10g and have installed ODBC via the instant client. I am able to use the ODBC administrator and set up a DSN and test successfully, and whenever I use Microsoft Access I can connect to my database no problem. I can also use Visual Web Developer to traverse the data.

But, when I try and use Classic ASP with:

myConn.Open "DSN=oracle10g;" & _ "Uid=myOracleUsername;" & "Pwd=myOraclePassword"

I get:

-2147467259Specified driver could not be loaded due to system error 5 (Oracle in instantclient10_2). An error occurred while trying to create Server Object.

I have searched various places but nothing seems to work. All ORACLE_HOME, TNSnames, IUSR_X security, all is correct. I am thinking it is a DSN connection string problem.

Anyone know?

Answer

Try using the following DSN-less connection string:

myConn.Open "Provider=MSDAORA;Data Source=instance_name;User ID=myOracleUsername;Password=myOraclePassword"

I've used this exact connection string for older version of Oracle client, but can't see any reason why it won't work for your version as well.