Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problems connection to Oracle 11g database from IIS7 classic ASP using ODBC

961611Sep 12 2012 — edited Sep 14 2012
I have a 64bit Oracle 11g database running on Server 2008 64bit. On a seperate Server 2008 64bit server I have a classic ASP website running on IIS7. I need to make a DSN (or DSN less) connection from the ASP to the Oracle database.

I installed the 32bit instant client (basic and odbc) on the IIS server and created a system DSN using the 32bit ODBC (c:\windows\syswow64\odbcad32.exe) and it tested OK (driver is "oracle in instantclient_11_2").

I have tried every combination of connection string I can think of from the ASP, but can't get it to connect successfuly:

The one I'm using currently: strConnection = "driver={oracle in instantclient_11_2};Data Source=XYZ;User Id=username;Password=password;"

(where XYZ is the name of the System DNS I created and also the SID of the database in question)

results in [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified

I have set the enviornment variable TNS_ADMIN=c:\app\oracle
and created a TNSNAMES.ORA in that directory:
XYZ =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=servername)(PORT=1521))
)
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE=XYZ)
(SID=XYZ)
)
)

Other connection strings:
strConnection = "Data Source=XYZ;User ID=username;Password=password;" = [Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified

strConnection = "driver={oracle in instantclient_11_2};Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=servername)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=XYZ)));User Id=username;Password=password;" = [Microsoft][ODBC Driver Manager] Data source name too long


I'm new to all of this, but it seems like this should be working! Help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 12 2012
Added on Sep 12 2012
3 comments
7,228 views