Error with ASP.NET opening OleDb/ODBC database

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Error with ASP.NET opening OleDb/ODBC database

    Hi there,

    I got a problem using an MS Access database through
    ASP.NET.

    After updating my system from .NET Framework 1.0 to 1.1,
    my existing
    application gives me the following error when opening a
    connection
    with the code below:

    "Unspecified error" (ErrorCode: -2147467259)

    string connectionStringKey = "LocalDBConnectionString";
    string connectionString
    = "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb";

    OdbcConnection connection = new OdbcConnection
    (connectionString);
    try
    {
    connection.Open();
    }
    catch (OdbcException ex)
    {
    string error = ex.Message;
    }
    finally
    {
    connection.Close();
    }

    What's really strange is that:
    1. The same application works on some of my colleagues'
    computers with
    the .net Framework 1.1
    2. The very same code works on my computer when creating a
    brand new
    application with VS.NET 2003
    3. The same application was working with .NET Framework 1.0

    The same thing happens (including the two cases above)
    when using ODBC
    classes instead of OleDB ones. In this case the connection
    string is:

    "FIL=MS Access;DSN=AIS_Local"

    and the error is:

    "ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    Disk or
    network error.\r\nERROR [IM006] [Microsoft][ODBC Driver
    Manager]
    Driver's SQLSetConnectAttr failed\r\nERROR [HY000]
    [Microsoft][ODBC
    Microsoft Access Driver] Disk or network error."

    Need HELP!!!
    tks
    Giuseppe D'Elia Guest

  2. Similar Questions and Discussions

    1. SQL Server - OLEDB or ODBC connection
      What are the advantages/disadvantages between selecting an ODBC and an OLEDB connection between MX and a SQL Server 2000 db...?
    2. Problem with OLEDB over ODBC
      I have an asp page used to access data from an access database. When I use the following as connection string (OLEDB)...
    3. Definite difference between using OLEDB and ODBC as the driver
      Hi All Some of you may not remember (or even care for that matter ;0)), but I mentioned in a previous post that I had difficulty using the OLEDB...
    4. CREATE DATABASE via ADO/OLEDB/ODBC
      Hello everybody, Is it possible to do a CREATE DATABASE via ADO using IFX OLEDB or IFX ODBC ?, apparently there is a connection string parameter...
    5. Connection string - ODBC vs OLEDB and Unspecified Error
      This one has me stumped and I was wondering if anyone might have a solution... Using this connection string ...
  3. #2

    Default Error with ASP.NET opening OleDb/ODBC database

    Just to help with a little more info on what might be the
    same problem.

    [url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    tabindex=1&PostID=225749

    I have the same problem that I can't access my mdb.
    I have enabled p/w on my db but this does not seem to work
    for me.

    If you solve the problem please post the solution.

    Peter
    >-----Original Message-----
    >Hi there,
    >
    >I got a problem using an MS Access database through
    >ASP.NET.
    >
    >After updating my system from .NET Framework 1.0 to 1.1,
    >my existing
    >application gives me the following error when opening a
    >connection
    >with the code below:
    >
    >"Unspecified error" (ErrorCode: -2147467259)
    >
    >string connectionStringKey = "LocalDBConnectionString";
    >string connectionString
    >= "Provider=Microsoft.Jet.OLEDB.4.0;Data
    >Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb" ;
    >
    >OdbcConnection connection = new OdbcConnection
    >(connectionString);
    >try
    >{
    >connection.Open();
    >}
    >catch (OdbcException ex)
    >{
    >string error = ex.Message;
    >}
    >finally
    >{
    >connection.Close();
    >}
    >
    >What's really strange is that:
    >1. The same application works on some of my colleagues'
    >computers with
    >the .net Framework 1.1
    >2. The very same code works on my computer when creating
    a
    >brand new
    >application with VS.NET 2003
    >3. The same application was working with .NET Framework
    1.0
    >
    >The same thing happens (including the two cases above)
    >when using ODBC
    >classes instead of OleDB ones. In this case the
    connection
    >string is:
    >
    >"FIL=MS Access;DSN=AIS_Local"
    >
    >and the error is:
    >
    >"ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    >Disk or
    >network error.\r\nERROR [IM006] [Microsoft][ODBC Driver
    >Manager]
    >Driver's SQLSetConnectAttr failed\r\nERROR [HY000]
    >[Microsoft][ODBC
    >Microsoft Access Driver] Disk or network error."
    >
    >Need HELP!!!
    >tks
    >.
    >
    Peter Guest

  4. #3

    Default Re: Error with ASP.NET opening OleDb/ODBC database

    Hi Peter, I had a similar problem with MSAccess. It was becasuse the ASPNET
    user (it seems this is the user that ASP.NET uses) did not have permissions
    to read/write ... in the directory I had chosen to place the file. I moved
    it into it's own directory and changed the permission to allow ASPNET to do
    anything and ... it worked.

    I'm using an XP machine. When I clicked on the properties for the folder,
    there was no security property. I had to change "folder options" in control
    panel away from "simple security" so that I could make this change. Then
    after I had it working, I changed "folder options" back to simple security
    and it's still working.

    That was what I did for my PC. Not necessarily the solution for you.

    "Peter" <peter@myresource.co.uk> wrote in message
    news:0b7801c351db$c9aa8870$a401280a@phx.gbl...
    > Just to help with a little more info on what might be the
    > same problem.
    >
    > [url]http://www.asp.net/Forums/ShowPost.aspx?[/url]
    > tabindex=1&PostID=225749
    >
    > I have the same problem that I can't access my mdb.
    > I have enabled p/w on my db but this does not seem to work
    > for me.
    >
    > If you solve the problem please post the solution.
    >
    > Peter
    >
    > >-----Original Message-----
    > >Hi there,
    > >
    > >I got a problem using an MS Access database through
    > >ASP.NET.
    > >
    > >After updating my system from .NET Framework 1.0 to 1.1,
    > >my existing
    > >application gives me the following error when opening a
    > >connection
    > >with the code below:
    > >
    > >"Unspecified error" (ErrorCode: -2147467259)
    > >
    > >string connectionStringKey = "LocalDBConnectionString";
    > >string connectionString
    > >= "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > >Source=C:\InetPub\wwwroot\IS_Italy_2003\IS.mdb" ;
    > >
    > >OdbcConnection connection = new OdbcConnection
    > >(connectionString);
    > >try
    > >{
    > >connection.Open();
    > >}
    > >catch (OdbcException ex)
    > >{
    > >string error = ex.Message;
    > >}
    > >finally
    > >{
    > >connection.Close();
    > >}
    > >
    > >What's really strange is that:
    > >1. The same application works on some of my colleagues'
    > >computers with
    > >the .net Framework 1.1
    > >2. The very same code works on my computer when creating
    > a
    > >brand new
    > >application with VS.NET 2003
    > >3. The same application was working with .NET Framework
    > 1.0
    > >
    > >The same thing happens (including the two cases above)
    > >when using ODBC
    > >classes instead of OleDB ones. In this case the
    > connection
    > >string is:
    > >
    > >"FIL=MS Access;DSN=AIS_Local"
    > >
    > >and the error is:
    > >
    > >"ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver]
    > >Disk or
    > >network error.\r\nERROR [IM006] [Microsoft][ODBC Driver
    > >Manager]
    > >Driver's SQLSetConnectAttr failed\r\nERROR [HY000]
    > >[Microsoft][ODBC
    > >Microsoft Access Driver] Disk or network error."
    > >
    > >Need HELP!!!
    > >tks
    > >.
    > >

    John Toop Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139