1 Reply Latest reply on Jul 4, 2018 1:54 AM by Thiyagu - Oracle

    [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

    3204902

      Hi,

      We have a classic ASP web application talking to Oracle database. Currently we are migrating this application to a new server whose OS is Windows Server 2012 R2. On the new server, we have installed & configured Oracle client successfully. TNSping, sqlplus, ODBC Data Source Administrator are all working properly. However, we are still facing a database connection issue of below.

      Code:

      <%
      Response.Write "<script>alert('Hello1');</script>"
      set MyCon = server.createobject("ADODB.connection")
      Response.Write "<script>alert('Hello2');</script>"
      MyCon.open "DRIVER={Microsoft ODBC for Oracle};ConnectionString=TNSName;UID=Username;PWD=Password;"
      Response.Write "<script>alert('Hello3');</script>"
      %>

       

      Error message:

      Microsoft OLE DB Provider for ODBC Drivers error '80004005'

      [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

      /MSDS/test.asp, line 21

       

      Hello1 & Hello2 popped up. But Hello3 didn't pop up. Do you have any ideas?

       

      Thanks!

        • 1. Re: [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
          Thiyagu - Oracle

          Hi

          Since you are using Microsoft driver we can not provider any suggestions. So please use Oracle  ODBC driver

           

          Sample Code :

          Const oracle_user = "scott"
          Const oracle_password = "tiger"
          Const oracle_sid  = "ORCL12C2"
          Const odbc_driver_name = "{Oracle in OraClient12Home1_32bit}"

          Set DBConnection = CreateObject("ADODB.Connection")
          Set SQLCommand = CreateObject("ADODB.Command")

          DBConnection.Open "Driver=" & odbc_driver_name & "; " & _
                        "DBQ=" & oracle_sid & "; " & _
                        "UID=" & oracle_user & "; " & _
                        "PWD=" & oracle_password & ";"

          Set SQLCommand.ActiveConnection = DBConnection

           

          Thanks

          Thiyagu