5 Replies Latest reply: Feb 7, 2013 8:19 AM by Tridus RSS

    I can`t connect to Oracle 11g64bits on a WindowsServer2008R264bits from ASP

    883679
      Hi,

      I am trying to connect to Oracle 11g 64 bits on a Windows Server 2008 R2 64 bits from ASP.

      But I can´t no matter what kind of provider or connect string I use.

      Please see this little video to better understanding. https://www.dropbox.com/s/cq7lx08nfad24yy/Oracle%20Connection%20Error.wmv

      I will apreciatte any help I have not ideia what is happening...

      This is my ASP code:

      Imports System.Data.OleDb
      Imports System.Data.OracleClient


      Public Class _Default
      Inherits System.Web.UI.Page

      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

      Dim cnn As OleDbConnection = New OleDbConnection()

      'SqlServer connection
      'cnn.ConnectionString = "Provider=sqloledb;Data Source=localhost;Persist Security Info=False;User ID=sa;Password=creative;Initial Catalog=DW_Decision;"

      'Oracle Connection
      'cnn.ConnectionString = "Provider=OraOLEDB.Oracle.1;Data Source=orcl64;Persist Security Info=False;User ID=scott;Password=creative;"
      'cnn.ConnectionString = "Provider=msdaora;Data Source=orcl64;User ID=scott;Password=creative;"

      'cnn.Open()
      'Label1.Text = "OK conexion"
      'cnn.Close()

      Dim cnn2 As OracleConnection = New OracleConnection()

      'Oracle Connection
      'cnn2.ConnectionString = "Data Source=orcl64;Integrated Security=yes;"
      cnn2.ConnectionString = "Data Source=orcl64;User Id=scott;Password=creative;Integrated Security=no;"

      cnn2.Open()
      Label1.Text = "OK conexion"
      cnn2.Close()

      End Sub

      End Class

      Edited by: 880676 on Feb 7, 2013 10:12 AM
        • 1. Re: I can`t connect to Oracle 11g64bits on a WindowsServer2008R264bits from ASP
          Tridus
          The error I saw said that it can't find the provider. Since you're running in 64 bit, the most common problem is that the bit-ness of your Oracle client and the application don't match.

          Did you install a 64 bit Oracle client? Is the IIS application pool for that page set to have 32 bit mode enabled? If so, that's your problem. Install a 32 bit Oracle client and it'll probably start working.
          • 2. Re: I can`t connect to Oracle 11g64bits on a WindowsServer2008R264bits from ASP
            883679
            Hi,

            Thanks for your response.

            Yes, I already have installed the 64 bits Oracle Client.

            Yes, the IIS application pool for that page set to have 32 bit mode enabled.

            Do you recomend me to install the 32 bits Oracle Client too ?

            Must I to delete the 64 bits Oracle Client first, or both Oracle Clients can live together in the same Windows Server ?

            Thanks in advance,
            • 3. Re: I can`t connect to Oracle 11g64bits on a WindowsServer2008R264bits from ASP
              Tridus
              880676 wrote:
              Yes, I already have installed the 64 bits Oracle Client.

              Yes, the IIS application pool for that page set to have 32 bit mode enabled.

              Do you recomend me to install the 32 bits Oracle Client too ?
              Yes. The bit-ness of the application and the Oracle client need to match. If the application is in 32 bit mode (which it is), you need a 32 bit Oracle client.
              Must I to delete the 64 bits Oracle Client first, or both Oracle Clients can live together in the same Windows Server ?
              It's not necessary to delete the 64 bit version. That said, if nothing else is using it I would remove it. It's a good idea to only install what you need. (If you do have both of them, install the 32 bit Oracle client into a different location.)
              • 4. Re: I can`t connect to Oracle 11g64bits on a WindowsServer2008R264bits from ASP
                883679
                Ok, I already installed the Oracle Client 32 in another folder.

                What reference must I include in the page?

                Currently I am using: Imports System.Data.OracleClient

                And what connect string should I use?, please see all options I tried...

                Thanks in advance,

                .........................................................................................

                Imports System.Data.OleDb
                Imports System.Data.OracleClient


                Public Class _Default
                Inherits System.Web.UI.Page

                Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

                Dim cnn As OleDbConnection = New OleDbConnection()

                'SqlServer connection
                'cnn.ConnectionString = "Provider=sqloledb;Data Source=localhost;Persist Security Info=False;User ID=sa;Password=creative;Initial Catalog=DW_Decision;"

                'Oracle Connection
                'cnn.ConnectionString = "Provider=OraOLEDB.Oracle.1;Data Source=orcl64;Persist Security Info=False;User ID=scott;Password=creative;"
                'cnn.ConnectionString = "Provider=msdaora;Data Source=orcl64;User ID=scott;Password=creative;"

                'cnn.Open()
                'Label1.Text = "OK conexion"
                'cnn.Close()

                Dim cnn2 As OracleConnection = New OracleConnection()

                'Oracle Connection
                'cnn2.ConnectionString = "Data Source=orcl64;Integrated Security=yes;"
                cnn2.ConnectionString = "Data Source=orcl64;User Id=scott;Password=creative;Integrated Security=no;"

                cnn2.Open()
                Label1.Text = "OK conexion"
                cnn2.Close()

                End Sub

                End Class
                • 5. Re: I can`t connect to Oracle 11g64bits on a WindowsServer2008R264bits from ASP
                  Tridus
                  880676 wrote:
                  'Oracle Connection
                  'cnn.ConnectionString = "Provider=OraOLEDB.Oracle.1;Data Source=orcl64;Persist Security Info=False;User ID=scott;Password=creative;"
                  'cnn.ConnectionString = "Provider=msdaora;Data Source=orcl64;User ID=scott;Password=creative;"
                  Neither of those works with the 32 bit driver? What about this one:

                  cnn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=orcl64;Persist Security Info=False;User ID=scott;Password=creative;"
                  Dim cnn2 As OracleConnection = New OracleConnection()

                  'Oracle Connection
                  'cnn2.ConnectionString = "Data Source=orcl64;Integrated Security=yes;"
                  cnn2.ConnectionString = "Data Source=orcl64;User Id=scott;Password=creative;Integrated Security=no;"
                  This one should work if "orcl64" is defined in your tnsnames.ora file, in the 32 bit Oracle driver's network\admin folder.

                  You're using Microsoft's Oracle .net driver here, though. To use the Oracle specific one, remove the reference and Imports for System.Data.OracleClient, and add one for Oracle.DataAccess.Client instead (you'll also need to add a reference to Oracle.DataAccess.dll, which should be in the list of installed assemblies).