This discussion is archived
3 Replies Latest reply: Sep 13, 2012 11:19 PM by 961611 RSS

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

961611 Newbie
Currently Being Moderated
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!

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points