Oracle Client and Networking comp not found

Oracle Client and Networking comp not found

Post by B Meye » Fri, 26 Jul 2002 06:20:26



We're trying to simply connect to an Oracle database from
ASP.NET.  We are using the
System.Data.OleDb.OleDbConnection object.   However, when
we try to open the connection, we're greeted with

"Oracle client and networking components were not found.
These components are supplied by Oracle Corporation and
are part of the Oracle Version 7.3.3 or later client
software installation. Provider is unable to function
until these components are installed."

We've reinstalled Oracle 8.1.7 client, still no luck.  
MDAC 2.7 is installed and we can connect to Oracle from
ASP as well as from Oracle SQLPlus.

We're running Windows 2000 Professional SP2 with IIS
installed and Microsoft .NET Framework
Version:1.0.3705.209; ASP.NET Version:1.0.3705.0

=============================================
Here is the code we are using.   Any thoughts?
=============================================
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Public Class WebForm1
    Inherits System.Web.UI.Page
    Protected WithEvents btnTest As
System.Web.UI.WebControls.Button
    Protected WithEvents OleDbConnection1 As
System.Data.OleDb.OleDbConnection
    Protected WithEvents Button As
System.Web.UI.WebControls.Button

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.De*StepThrough()> Private Sub
InitializeComponent()
        Me.OleDbConnection1 = New
System.Data.OleDb.OleDbConnection()
        '
        'OleDbConnection1
        '
        Me.OleDbConnection1.ConnectionString
= "Provider=MSDAORA.1;Password=time4game;User ID=igi;Data
Source=test"

    End Sub

    Private Sub Page_Init(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Init
        'CODEGEN: This method call is required by the Web
Form Designer
        'Do not modify it using the code editor.
        InitializeComponent()
    End Sub

#End Region

    Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
    End Sub

    Private Sub btnTest_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
btnTest.Click
        Dim sConnectionString As String
= "Provider=MSDAORA.1;Password=time4game;User ID=igi;Data
Source=test;Persist Security Info=false"
        '            = "Provider=MSDAORA.1;User
ID=igi;password=time4game;Data Source=test"
        Dim mySelectQuery As String = "SELECT * FROM
AdminTasks"
        Dim myConnection As New OleDbConnection
(sConnectionString)
        Dim myCommand As New OleDbCommand(mySelectQuery,
myConnection)

        'Set the parameter value.

OleDbType.Char, 5).Value = "Test%"

        'Open connection to Oracle database.
        myConnection.Open()

        'Populate the DataReader.
        Dim myReader As OleDbDataReader =
myCommand.ExecuteReader()
        Dim RecordCount As Integer
        Try
            While myReader.Read()
                RecordCount = RecordCount + 1
                Response.Write(myReader.GetString
(0).ToString())
            End While
            If RecordCount = 0 Then
                Response.Write("No data returned")
            Else
                Response.Write("Number of records
returned: " & RecordCount)
            End If
        Catch ex As Exception
            Response.Write(ex.ToString())
        Finally

            'Close all objects.
            myReader.Close()
            myConnection.Close()
        End Try
    End Sub

End Class

=============================================
Here is the error
=============================================

Description: An unhandled exception occurred during the
execution of the current web request. Please review the
stack trace for more information about the error and where
it originated in the code.

Exception Details: System.Data.OleDb.OleDbException:
Oracle client and networking components were not found.
These components are supplied by Oracle Corporation and
are part of the Oracle Version 7.3.3 or later client
software installation. Provider is unable to function
until these components are installed.

Source Error:

Line 48:
Line 49:         'Open connection to Oracle database.
Line 50:         myConnection.Open()
Line 51:
Line 52:         'Populate the DataReader.

Source File:
D:\Inetpub\wwwroot\offcampus\WebForm1.aspx.vb    Line: 50

Stack Trace:

[OleDbException (0x80004005): Oracle client and networking
components were not found. These components are supplied
by Oracle Corporation and are part of the Oracle Version
7.3.3 or later client software installation.

Provider is unable to function until these components are
installed.]
   System.Data.OleDb.OleDbConnection.ProcessResults(Int32
hr)
   System.Data.OleDb.OleDbConnection.InitializeProvider()
   System.Data.OleDb.OleDbConnection.Open()
   offcampus.WebForm1.btnTest_Click(Object sender,
EventArgs e) in
D:\Inetpub\wwwroot\offcampus\WebForm1.aspx.vb:50
   System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEve
ntHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain()

-----------------------------------------------------------
---------------------
Version Information: Microsoft .NET Framework
Version:1.0.3705.209; ASP.NET Version:1.0.3705.0

 
 
 

Oracle Client and Networking comp not found

Post by Rames » Fri, 26 Jul 2002 06:48:32


I would definitely check to see if I can connect to Oracle using SQL Plust
utitlity if this doesnt work that means its a bad install or some kind of
configuration issue.
If sql plus connects fine we may be looking at some permissions issue.

Eventhough you use ASP.NET check out this article on Troubleshooting
ASP-to-Oracle Connectivity problem
http://support.microsoft.com/?scid=kb;en-us;Q255084

This list most possible causes for that error message you see.
Importantly Steps 3,5,6,7

Hope this helps

Ramesh Thyagarajan, MCSD,MCDBA
Microsoft Developer support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

 
 
 

Oracle Client and Networking comp not found

Post by Bruce L- » Sun, 28 Jul 2002 08:18:23


OK, here is what is happening. The MS OLEDB Provider for Oracle by default
is looking for pre-8i client (we used it with an 8.0 client). I think there
is a way to mess with the registry to get it to use 8i but I would suggest
instead to use the Oracle OLEDB provider that comes with 8.1.7 (plus there
is patch for it on Metalink). In some cases (slow communication lines) it is
much faster than the MS Oracle provider. It also has some functionality not
there in the MS Oracle provider.

Bruce L-C

> We're trying to simply connect to an Oracle database from
> ASP.NET.  We are using the
> System.Data.OleDb.OleDbConnection object.   However, when
> we try to open the connection, we're greeted with

> "Oracle client and networking components were not found.
> These components are supplied by Oracle Corporation and
> are part of the Oracle Version 7.3.3 or later client
> software installation. Provider is unable to function
> until these components are installed."

> We've reinstalled Oracle 8.1.7 client, still no luck.
> MDAC 2.7 is installed and we can connect to Oracle from
> ASP as well as from Oracle SQLPlus.

> We're running Windows 2000 Professional SP2 with IIS
> installed and Microsoft .NET Framework
> Version:1.0.3705.209; ASP.NET Version:1.0.3705.0

> =============================================
> Here is the code we are using.   Any thoughts?
> =============================================
> Imports System
> Imports System.Data
> Imports System.Data.OleDb
> Imports System.Web
> Imports System.Web.UI
> Imports System.Web.UI.WebControls

> Public Class WebForm1
>     Inherits System.Web.UI.Page
>     Protected WithEvents btnTest As
> System.Web.UI.WebControls.Button
>     Protected WithEvents OleDbConnection1 As
> System.Data.OleDb.OleDbConnection
>     Protected WithEvents Button As
> System.Web.UI.WebControls.Button

> #Region " Web Form Designer Generated Code "

>     'This call is required by the Web Form Designer.
>     <System.Diagnostics.De*StepThrough()> Private Sub
> InitializeComponent()
>         Me.OleDbConnection1 = New
> System.Data.OleDb.OleDbConnection()
>         '
>         'OleDbConnection1
>         '
>         Me.OleDbConnection1.ConnectionString
> = "Provider=MSDAORA.1;Password=time4game;User ID=igi;Data
> Source=test"

>     End Sub

>     Private Sub Page_Init(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles MyBase.Init
>         'CODEGEN: This method call is required by the Web
> Form Designer
>         'Do not modify it using the code editor.
>         InitializeComponent()
>     End Sub

> #End Region

>     Private Sub Page_Load(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles MyBase.Load
>         'Put user code to initialize the page here
>     End Sub

>     Private Sub btnTest_Click(ByVal sender As
> System.Object, ByVal e As System.EventArgs) Handles
> btnTest.Click
>         Dim sConnectionString As String
> = "Provider=MSDAORA.1;Password=time4game;User ID=igi;Data
> Source=test;Persist Security Info=false"
>         '            = "Provider=MSDAORA.1;User
> ID=igi;password=time4game;Data Source=test"
>         Dim mySelectQuery As String = "SELECT * FROM
> AdminTasks"
>         Dim myConnection As New OleDbConnection
> (sConnectionString)
>         Dim myCommand As New OleDbCommand(mySelectQuery,
> myConnection)

>         'Set the parameter value.

> OleDbType.Char, 5).Value = "Test%"

>         'Open connection to Oracle database.
>         myConnection.Open()

>         'Populate the DataReader.
>         Dim myReader As OleDbDataReader =
> myCommand.ExecuteReader()
>         Dim RecordCount As Integer
>         Try
>             While myReader.Read()
>                 RecordCount = RecordCount + 1
>                 Response.Write(myReader.GetString
> (0).ToString())
>             End While
>             If RecordCount = 0 Then
>                 Response.Write("No data returned")
>             Else
>                 Response.Write("Number of records
> returned: " & RecordCount)
>             End If
>         Catch ex As Exception
>             Response.Write(ex.ToString())
>         Finally

>             'Close all objects.
>             myReader.Close()
>             myConnection.Close()
>         End Try
>     End Sub

> End Class

> =============================================
> Here is the error
> =============================================

> Description: An unhandled exception occurred during the
> execution of the current web request. Please review the
> stack trace for more information about the error and where
> it originated in the code.

> Exception Details: System.Data.OleDb.OleDbException:
> Oracle client and networking components were not found.
> These components are supplied by Oracle Corporation and
> are part of the Oracle Version 7.3.3 or later client
> software installation. Provider is unable to function
> until these components are installed.

> Source Error:

> Line 48:
> Line 49:         'Open connection to Oracle database.
> Line 50:         myConnection.Open()
> Line 51:
> Line 52:         'Populate the DataReader.

> Source File:
> D:\Inetpub\wwwroot\offcampus\WebForm1.aspx.vb    Line: 50

> Stack Trace:

> [OleDbException (0x80004005): Oracle client and networking
> components were not found. These components are supplied
> by Oracle Corporation and are part of the Oracle Version
> 7.3.3 or later client software installation.

> Provider is unable to function until these components are
> installed.]
>    System.Data.OleDb.OleDbConnection.ProcessResults(Int32
> hr)
>    System.Data.OleDb.OleDbConnection.InitializeProvider()
>    System.Data.OleDb.OleDbConnection.Open()
>    offcampus.WebForm1.btnTest_Click(Object sender,
> EventArgs e) in
> D:\Inetpub\wwwroot\offcampus\WebForm1.aspx.vb:50
>    System.Web.UI.WebControls.Button.OnClick(EventArgs e)

> System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEve
> ntHandler.RaisePostBackEvent(String eventArgument)
>    System.Web.UI.Page.RaisePostBackEvent
> (IPostBackEventHandler sourceControl, String eventArgument)
>    System.Web.UI.Page.RaisePostBackEvent
> (NameValueCollection postData)
>    System.Web.UI.Page.ProcessRequestMain()

> -----------------------------------------------------------
> ---------------------
> Version Information: Microsoft .NET Framework
> Version:1.0.3705.209; ASP.NET Version:1.0.3705.0