Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).

Posted on 2004-10-28
3
Medium Priority
?
2,846 Views
Last Modified: 2008-01-09
I have a C# application and I am migrating it to another machine. It seems to be an issue when I create the odbc connection, with compatibility. I am not sure. But I am stuck on this problem and it is driving me nuts. I am sure that someone has solved this problem before. I would appreciate any immediate response.


======================================================
Server Error in '/MSPOS' Application.
--------------------------------------------------------------------------------

ERROR [IM003] Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).
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.Odbc.OdbcException: ERROR [IM003] Specified driver could not be loaded due to system error 5 (Oracle in OraHome92).

Source Error:


Line 73: {
Line 74:       OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
Line 75:     myConnection.Open();
Line 76:          
Line 77:     // get records from the table
 

Source File: D:\Inetpub\wwwroot\MSPOS\Stores.aspx    Line: 75

Stack Trace:


[OdbcException: ERROR [IM003] Specified driver could not be loaded due to system error  5 (Oracle in OraHome92).]
   System.Data.Odbc.OdbcConnection.Open() +638
   ASP.Stores_aspx.BindData() in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:75
   ASP.Stores_aspx.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:64
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +731

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Request Details
Session Id: yy1gqs45c0hhs555vgnb0b45 Request Type: GET
Time of Request: 10/28/2004 2:56:47 AM Status Code: 500
Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8)
Trace Information
Category Message From First(s) From Last(s)
aspx.page Begin Init  
aspx.page End Init 0.000168 0.000168
Unhandled Execution Error
ERROR [IM003] Specified driver could not be loaded due to system error  5 (Oracle in OraHome92).
  at System.Data.Odbc.OdbcConnection.Open()
  at ASP.Stores_aspx.BindData() in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:line 75
  at ASP.Stores_aspx.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\MSPOS\Stores.aspx:line 64
  at System.Web.UI.Control.OnLoad(EventArgs e)
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Page.ProcessRequestMain()
==========================================================================



Now here is my code:

<%@ Page Language="c#" trace="true" %>
<%@ Register TagPrefix="uc1" TagName="logout" Src="Engine/Controls/logout.ascx" %>
<%@ import namespace="System.Data.Odbc" %>
<%@ import namespace="System.Web.UI" %>
<%@ import namespace="System.Web.SessionState" %>
<%@ import namespace="System.Web" %>
<%@ import namespace="System.Drawing" %>
<%@ import namespace="System.ComponentModel" %>
<%@ import namespace="System.Collections" %>
<%@ import namespace="System.Text" %>
<%@ import namespace="System.Data" %>
<%@ Register TagPrefix="mspos" TagName="header" Src="~/Engine/Controls/header.ascx" %>
<%@ Register TagPrefix="mspos" TagName="footer" Src="~/Engine/Controls/footer.ascx" %>
<HTML>
<HEAD>
<title>Users Interface to Managing Adminitrators</title>
<meta content="True" name="vs_snapToGrid">
<script language="C#" runat="server">
protected string AccessLevel = null;
private DataSet ddlDataSet = new DataSet();
private OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
private DataSet ddlDataSet1 = new DataSet();

private void MainMenu_Click(Object sender, ImageClickEventArgs e)
{
   AccessLevel = Session["Authenticated"].ToString();
      if (AccessLevel == "1")
            Response.Redirect("AdminStart.aspx");        
      else if (AccessLevel == "2")
            Response.Redirect("CCManStart.aspx");        
      else if (AccessLevel == "3")
            Response.Redirect("CCashierStart.aspx");        
      else if (AccessLevel == "4")
            Response.Redirect("CashierStart.aspx");        
      else Response.Redirect("Error.aspx");
}

//************************************************************
// Get Stores and populate dataset with STOREID and Store
private DataSet BindStores()
{
      OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");

    // Populate the ddlDataSet
   myConnection.Open();
   const string strSQLDDL = @"SELECT STOREID, STORE FROM TBSTORES ORDER BY STOREID";
   OdbcDataAdapter myDataAdapter = new OdbcDataAdapter(strSQLDDL, myConnection);
   ddlDataSet1.Clear();  
   myDataAdapter.Fill(ddlDataSet1, "ddlStores");
   myDataAdapter.Dispose();
   myDataAdapter = null;
   myConnection.Close();
   return ddlDataSet1;
}
//************************************************************
 
 
 
//****************************************************************
protected void Page_Load(object sender, System.EventArgs e)
{
      if (!Page.IsPostBack)
      {
            BindData();
      }
}
//****************************************************************



//****************************************************************
private void BindData()
{
      OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
    myConnection.Open();
         
    // get records from the table
    string commandString = @"SELECT STOREID, STORE FROM TBSTORES ORDER BY STOREID";      
    // Set the datagrid's datasource to the datareader and databind
    // Create a OdbcCommand object and assign the connection connect to the database
    OdbcCommand command = myConnection.CreateCommand( );
    command.CommandText = commandString;
    command.Connection = myConnection;
      // Create the Reader and bind it to the datagrid
    OdbcDataReader reader =  command.ExecuteReader(CommandBehavior.CloseConnection);
    DataGridUserManagementID.DataSource=reader;
    DataGridUserManagementID.DataBind();
      reader.Close();
      reader=null;
    myConnection.Dispose();
      myConnection.Close();
          
}
//****************************************************************

//************************************************************
private void DataGridUserManagementID_SelectedIndexChanged(object sender, System.EventArgs e)
{
      int intCount;
      for (intCount = 1; intCount <= DataGridUserManagementID.Items.Count; intCount ++)
          DataGridUserManagementID.Items[intCount - 1].BorderStyle =  BorderStyle.Groove;

      DataGridUserManagementID.SelectedItem.BorderStyle = BorderStyle.Dashed;
}
//************************************************************



//****************************************************************
private void DataGridUserManagementID_Delete(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    // Get the StoreID of the row whose Delete button was clicked
   
    string strStoreID = ((Label)e.Item.FindControl("lblStoreID")).Text;
    int SelectedStoreID = Convert.ToInt32(strStoreID);
      string strSQL="Delete From TBSTORES where STOREID='"+ SelectedStoreID +"'";
    ExecuteQuery(strSQL);
    DataGridUserManagementID.EditItemIndex = -1;
    BindData();
}
//****************************************************************



//***************************************************************
private int ExecuteQuery(string sqlCmd)
{
   // Create a OdbcCommand object and assign the connection connect to the database
   OdbcConnection myConnection =  new OdbcConnection("DSN=MSPOS;UID=system;PWD=system");
   myConnection.Open();
   OdbcCommand command = myConnection.CreateCommand( );
   command.CommandText = sqlCmd;
   command.Connection = myConnection;
   return command.ExecuteNonQuery();
}
//***************************************************************



//***************************************************************
private void DataGridUserManagementID_Update(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    // Determine what store was selected
    string strStoreID, strStore;
    // Declare Textboxes
       // Gets the value of the key field of the row being updated
      strStoreID = ((Label)e.Item.FindControl("lblStoreID")).Text;
    strStore = ((TextBox)e.Item.FindControl("editStores")).Text;    
     
   
      // form the update statement
    // connect to the database
      string cmd="Update TBSTORES Set STORE='"+ strStore +"' Where StoreID = "+ strStoreID +"";
         ExecuteQuery(cmd);
         DataGridUserManagementID.EditItemIndex = -1;
    BindData(  );
   
}
//************************************************************************



//************************************************************************
protected int GetSelectedIndexStore(string StoreID)
{  
   int iLoop;  
   DataTable dt = ddlDataSet1.Tables["ddlStores"];  
   for (iLoop=0; iLoop < dt.Rows.Count - 1; iLoop++)
   {  
            if (StoreID.Equals(dt.Rows[iLoop]["STOREID"].ToString()))  
              return iLoop;  
   };  
   return 0;  
 
}
//***************************************************************


//****************************************************************
private void DataGridUserManagementID_Edit(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
      DataGridUserManagementID.EditItemIndex = e.Item.ItemIndex;
    BindData();
}
//****************************************************************



//************************************************************************
protected void DataGridUserManagementID_ItemCreated(Object sender, DataGridItemEventArgs e)
{
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
      {
            ImageButton btn = (ImageButton)e.Item.FindControl("btnDel");
          btn.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item.')");
      }
}
//************************************************************************


//******************************************************************************
private void DataGridUserManagementID_ItemDataBound(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
    ListItemType oType = ((ListItemType)e.Item.ItemType);
    if(oType == ListItemType.Item || oType == ListItemType.AlternatingItem)
    {
            e.Item.Attributes.Add("onmouseover", "this.style.backgroundColor='lightblue'");            
            e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='Beige'");            
      }


}
//***************************************************************


//************************************************************************
protected void DataGridUserManagementID_ItemCommand(object sender, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{

    if (e.CommandName == "Insert")
    {
       TextBox txtStore;
       ///... declarations for remaining data fields
 
       string strSQL;
         string storename;
        
         txtStore = (TextBox)e.Item.FindControl("add_storeID");
       storename = txtStore.Text;
       OdbcCommand command = myConnection.CreateCommand( );
         command.Connection = myConnection;
       
       // Create the appropriate SQL statement
       strSQL = "INSERT INTO TBSTORES (STORE) VALUES ('" +storename+"'"+")";
       if (storename != "")
                  ExecuteQuery(strSQL);
       DataGridUserManagementID.EditItemIndex = -1;
       BindData();
    }
}
//************************************************************************


//****************************************************************
private void DataGridUserManagementID_Cancel(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
    DataGridUserManagementID.EditItemIndex = -1;
    BindData();
}
//****************************************************************

            </script>
</HEAD>
<body bgColor="#fef9e9" leftMargin="0" background="images/bg.gif" topMargin="0" marginwidth="0"
            marginheigh="0">
<mspos:header id="header" runat="server"></mspos:header>
<center>
<form id="form1" runat="server">
<TABLE height="380" cellSpacing="0" cellPadding="0" width="587" border="0" ms_2d_layout="TRUE">
<TR vAlign="top">
<TD width="368" height="29">
<!-- Include start of header --------------------------------------------></TD>
<TD width="575" height="29">
<P align="center"><BR>
<asp:imagebutton id="Imagebutton1" onclick="MainMenu_Click" runat="server" ImageUrl="images/main.jpg"></asp:imagebutton><BR>
<BR>
</P>
</TD>
<TD width="702" height="29"></TD>
</TR>
<TR vAlign="top">
<TD width="368" height="272"></TD>
<TD width="575" height="272"><asp:datagrid id="DataGridUserManagementID" runat="server" BorderWidth="3" BorderColor="#CCCC99"
                                                PagerStyle-HorizontalAlign="Right" width="449px" font-names="Verdana" font-size="xx-small"
                                                BorderStyle="Outset" GridLines="None" AutoGenerateColumns="False" ShowFooter="True" AllowCustomPaging="True"
                                                AllowPaging="True" OnItemCommand="DataGridUserManagementID_ItemCommand" OnItemCreated="DataGridUserManagementID_ItemCreated"
                                                OnEditCommand="DataGridUserManagementID_Edit" OnItemDataBound="DataGridUserManagementID_ItemDataBound"
                                                OnCancelCommand="DataGridUserManagementID_Cancel" OnUpdateCommand="DataGridUserManagementID_Update"
                                                OnDeleteCommand="DataGridUserManagementID_Delete">
<FooterStyle ForeColor="#330099" BackColor="#FFFFCC"></FooterStyle>
<SelectedItemStyle Font-Bold="True" ForeColor="#663399" BackColor="#FFCC66"></SelectedItemStyle>
<AlternatingItemStyle BackColor="PaleGoldenrod"></AlternatingItemStyle>
<ItemStyle BackColor="Beige"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#954896"></HeaderStyle>
<Columns>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="&lt;img src=images/Ok.gif border=0 align=absmiddle alt='Save changes'&gt;"
                                                            CancelText="&lt;img src=images/Cancel.gif border=0 align=absmiddle alt='Cancel editing'&gt;"
                                                            EditText="&lt;img src=images/icn_edit.gif border=0 align=absmiddle alt='Edit this item'&gt;"></asp:EditCommandColumn>
<asp:TemplateColumn HeaderText="StoreID">
<ItemTemplate>
<asp:Label Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem, "STOREID")) %>' Font-Bold="true" Runat="server" ID="lblStoreID">
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Store Name">
<ItemTemplate>
<asp:Label id=lblStore Runat="server" Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem,"STORE")) %>'>
</asp:Label>
</ItemTemplate>
<FooterTemplate>
<asp:TextBox id="add_storeID" Width="150" runat="server"></asp:TextBox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id=editStores Width="150" Runat="server" Text='<%# Convert.ToString(DataBinder.Eval(Container.DataItem,"STORE")) %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn HeaderText="Delete">
<ItemTemplate>
<asp:ImageButton CommandName="Delete" id="btnDel" runat="server" Runat="server" alt='Delete this item?'
                                                                        ImageUrl="images/icn_del.gif"></asp:ImageButton>
</ItemTemplate>
<FooterTemplate>
<asp:ImageButton CommandName="Insert" id="btnAdd" runat="server" alt='Add new item' ImageUrl="images/icn_add.gif"></asp:ImageButton>
</FooterTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle HorizontalAlign="Center" ForeColor="#330099" BackColor="#FFFFCC"></PagerStyle>
</asp:datagrid>
<P align="center">
<uc1:logout id="Logout1" runat="server"></uc1:logout><BR>
<BR>
<mspos:footer id="footer" runat="server"></mspos:footer></P>
</TD>
<TD height="272"></TD>
</TR>
</TABLE>
</form>
</center> <!-- Include start of footer ------------------------------------------------> <!--------------------------------------------------------------------------->
</body>
</HTML>
0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 12433278
I'm thinking this is the same problem that has been around for a while with ASP(.Net) and Oracle.  I can't say for sure since I don't use ODBC but it sure smells the same.

On the new machine grant the following permissions to the ASPNET user from the oracle directory (make sure it recurses to all subdirectories).  If you don't like this idea:  In a nutshell, the ASPNET user needs explicit grants down to the bin directory to get at the drivers.  Even if 'Everyone' has full access, it will still fail.

Grant:
Read & Execute
List Folder Contents
Read

0
 

Author Comment

by:mathieu_cupryk
ID: 12434511
I am trying. what do u mean GRANT List Folder Contents.
0
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 12434872
What version of Windows is on your web server?

In a nutshell, you need to set the permissions on the Oracle directory:
For example (this is slightly different across Windows):

Right click on the oracle directory.
Select Properties.
Go to Security.

You should see a list of users/groups on top and a list of permissions on the bottom.

Select 'Add' then locate the ASPNET user.  Then select the permissions I stated above for ASPNET.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question