Problem connecting to Access Database from ASP.NET Application

Discussion in 'ASP .Net' started by Nathan Sokalski, Jun 7, 2005.

  1. I am trying to connect to a Microsoft Access Database from my ASP.NET
    Application. I use the following code to create my connection string:

    cmdSelect.Connection = New
    System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE="
    & Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))


    Although the error does not occur until the Fill() method is called:

    dataadapterSelect.Fill(ratedpoems, "poemratings")


    I have a feeling the problem is in my connection string, but I do not know
    what the problem is. The error returned when I try to view the page in my
    browser is:

    [OleDbException (0x80004005): Could not find installable ISAM.]
    System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    System.Data.OleDb.OleDbConnection.Open() +203
    System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    ConnectionState& originalState) +44
    System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    CommandBehavior behavior) +304
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
    Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    behavior) +77
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
    +36
    WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    EventArgs e) in
    c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e)
    in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    System.Web.UI.Control.OnLoad(EventArgs e) +67
    System.Web.UI.Control.LoadRecursive() +35
    System.Web.UI.Page.ProcessRequestMain() +750


    Can someone please help me figure out what I am doing wrong or what my
    connection string should look like? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/
     
    Nathan Sokalski, Jun 7, 2005
    #1
    1. Advertising

  2. Try :

    PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=

    DATA SOURCE is 2 words, not one.



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Nathan Sokalski" <> wrote in message
    news:%23XC%...
    >I am trying to connect to a Microsoft Access Database from my ASP.NET Application. I use
    >the following code to create my connection string:
    >
    > cmdSelect.Connection = New
    > System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE=" &
    > Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    >
    >
    > Although the error does not occur until the Fill() method is called:
    >
    > dataadapterSelect.Fill(ratedpoems, "poemratings")
    >
    >
    > I have a feeling the problem is in my connection string, but I do not know what the
    > problem is. The error returned when I try to view the page in my browser is:
    >
    > [OleDbException (0x80004005): Could not find installable ISAM.]
    > System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    > System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    > System.Data.OleDb.OleDbConnection.Open() +203
    > System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState&
    > originalState) +44
    > System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32
    > maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32
    > maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
    > WebApplication1.poetry.poemratings.SortPoems_Click(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    > WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    > System.Web.UI.Control.OnLoad(EventArgs e) +67
    > System.Web.UI.Control.LoadRecursive() +35
    > System.Web.UI.Page.ProcessRequestMain() +750
    >
    >
    > Can someone please help me figure out what I am doing wrong or what my connection string
    > should look like? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
     
    Juan T. Llibre, Jun 7, 2005
    #2
    1. Advertising

  3. Thank you for that information, it was definitely an error that would have
    caused me problems. However, I am now recieving the following error:

    [OleDbException (0x80004005): The Microsoft Jet database engine cannot open
    the file 'c:\inetpub\wwwroot\WebApplication1\nathansokalski_com.mdb'. It is
    already opened exclusively by another user, or you need permission to view
    its data.]
    System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    System.Data.OleDb.OleDbConnection.Open() +203
    System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    ConnectionState& originalState) +44
    System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    CommandBehavior behavior) +304
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord,
    Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
    behavior) +77
    System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
    +36
    WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    EventArgs e) in
    c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e)
    in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    System.Web.UI.Control.OnLoad(EventArgs e) +67
    System.Web.UI.Control.LoadRecursive() +35
    System.Web.UI.Page.ProcessRequestMain() +750

    I know it is not opened by another user (including me, because this is the
    first thing I did after booting my computer). I tried looking at the
    security tab in the properties of nathansokalski_com.mdb, but the only 2
    accounts there were mine and SYSTEM (it did not list others like Internet
    Guest Account, Launch IIS Process Account, VS Developers, etc.). It is
    listed in Visual Studio as part of the Application. What do I need to do to
    either the file or my code to be able to use the database? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Juan T. Llibre" <> wrote in message
    news:...
    > Try :
    >
    > PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=
    >
    > DATA SOURCE is 2 words, not one.
    >
    >
    >
    > Juan T. Llibre
    > ASP.NET MVP
    > http://asp.net.do/foros/
    > Foros de ASP.NET en Español
    > Ven, y hablemos de ASP.NET...
    > ======================
    >
    > "Nathan Sokalski" <> wrote in message
    > news:%23XC%...
    >>I am trying to connect to a Microsoft Access Database from my ASP.NET
    >>Application. I use the following code to create my connection string:
    >>
    >> cmdSelect.Connection = New
    >> System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE="
    >> & Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    >>
    >>
    >> Although the error does not occur until the Fill() method is called:
    >>
    >> dataadapterSelect.Fill(ratedpoems, "poemratings")
    >>
    >>
    >> I have a feeling the problem is in my connection string, but I do not
    >> know what the problem is. The error returned when I try to view the page
    >> in my browser is:
    >>
    >> [OleDbException (0x80004005): Could not find installable ISAM.]
    >> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >> System.Data.OleDb.OleDbConnection.Open() +203
    >> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >> ConnectionState& originalState) +44
    >> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    >> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >> CommandBehavior behavior) +304
    >> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    >> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >> CommandBehavior behavior) +77
    >> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
    >> +36
    >> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    >> EventArgs e) in
    >> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs
    >> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >> System.Web.UI.Control.LoadRecursive() +35
    >> System.Web.UI.Page.ProcessRequestMain() +750
    >>
    >>
    >> Can someone please help me figure out what I am doing wrong or what my
    >> connection string should look like? Thanks.
    >> --
    >> Nathan Sokalski
    >>
    >> http://www.nathansokalski.com/
    >>

    >
    >
     
    Nathan Sokalski, Jun 7, 2005
    #3
  4. Hi, Nathan.

    Here's a short file you can use to determine
    which account ASP.NET is running as :
    -----------------
    <%@ Page Language="VB" %>
    <%@ Import NameSpace = System.Security.Principal %>
    <script runat="server">
    Sub Page_Load()
    Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    Label1.Text = tmp
    End Sub
    </script>
    <html>
    <head>
    <title>WindowsIdentity.GetCurrent.Name()</title>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    </div>
    </form>
    </body>
    </html>
    -------------

    Run it, and it will tell you the name of the account you need to give read/write
    permissions to, for the directory where your mdb file is located, so it's allowed
    to read and write to the database.

    Are you running a secured database ( username/password needed to read it ? )
    Or just using the admin with no password ?



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Nathan Sokalski" <> wrote in message
    news:...
    > Thank you for that information, it was definitely an error that would have caused me
    > problems. However, I am now recieving the following error:
    >
    > [OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file
    > 'c:\inetpub\wwwroot\WebApplication1\nathansokalski_com.mdb'. It is already opened
    > exclusively by another user, or you need permission to view its data.]
    > System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    > System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    > System.Data.OleDb.OleDbConnection.Open() +203
    > System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState&
    > originalState) +44
    > System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32
    > maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32
    > maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    > System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
    > WebApplication1.poetry.poemratings.SortPoems_Click(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    > WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e) in
    > c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    > System.Web.UI.Control.OnLoad(EventArgs e) +67
    > System.Web.UI.Control.LoadRecursive() +35
    > System.Web.UI.Page.ProcessRequestMain() +750
    >
    > I know it is not opened by another user (including me, because this is the first thing I
    > did after booting my computer). I tried looking at the security tab in the properties of
    > nathansokalski_com.mdb, but the only 2 accounts there were mine and SYSTEM (it did not
    > list others like Internet Guest Account, Launch IIS Process Account, VS Developers,
    > etc.). It is listed in Visual Studio as part of the Application. What do I need to do to
    > either the file or my code to be able to use the database? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> Try :
    >>
    >> PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=
    >>
    >> DATA SOURCE is 2 words, not one.
    >>
    >>
    >>
    >> Juan T. Llibre
    >> ASP.NET MVP
    >> http://asp.net.do/foros/
    >> Foros de ASP.NET en Español
    >> Ven, y hablemos de ASP.NET...
    >> ======================
    >>
    >> "Nathan Sokalski" <> wrote in message
    >> news:%23XC%...
    >>>I am trying to connect to a Microsoft Access Database from my ASP.NET Application. I
    >>>use the following code to create my connection string:
    >>>
    >>> cmdSelect.Connection = New
    >>> System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE=" &
    >>> Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    >>>
    >>>
    >>> Although the error does not occur until the Fill() method is called:
    >>>
    >>> dataadapterSelect.Fill(ratedpoems, "poemratings")
    >>>
    >>>
    >>> I have a feeling the problem is in my connection string, but I do not know what the
    >>> problem is. The error returned when I try to view the page in my browser is:
    >>>
    >>> [OleDbException (0x80004005): Could not find installable ISAM.]
    >>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>> System.Data.OleDb.OleDbConnection.Open() +203
    >>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >>> ConnectionState& originalState) +44
    >>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord,
    >>> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
    >>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32
    >>> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    >>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
    >>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender, EventArgs e) in
    >>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e) in
    >>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>> System.Web.UI.Control.LoadRecursive() +35
    >>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>
    >>>
    >>> Can someone please help me figure out what I am doing wrong or what my connection
    >>> string should look like? Thanks.
    >>> --
    >>> Nathan Sokalski
    >>>
    >>> http://www.nathansokalski.com/
    >>>

    >>
    >>

    >
    >
     
    Juan T. Llibre, Jun 7, 2005
    #4
  5. When I ran the code you gave me, the account it returned was NJS\ASPNET,
    which is what I expected, however, that account is not listed under the
    Security tab for the mdb file or the directory that the mdb file is in (I
    could not find the account listed for anything). I did notice, however, that
    the following directory existed on my computer:

    C:\Documents and Settings\NJS\ASPNET

    How can I give the account the necessary permissions when it is not listed
    under the Security tab? Thanks.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Juan T. Llibre" <> wrote in message
    news:...
    > Hi, Nathan.
    >
    > Here's a short file you can use to determine
    > which account ASP.NET is running as :
    > -----------------
    > <%@ Page Language="VB" %>
    > <%@ Import NameSpace = System.Security.Principal %>
    > <script runat="server">
    > Sub Page_Load()
    > Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    > Label1.Text = tmp
    > End Sub
    > </script>
    > <html>
    > <head>
    > <title>WindowsIdentity.GetCurrent.Name()</title>
    > </head>
    > <body>
    > <form id="form1" runat="server">
    > <div>
    > <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    > </div>
    > </form>
    > </body>
    > </html>
    > -------------
    >
    > Run it, and it will tell you the name of the account you need to give
    > read/write
    > permissions to, for the directory where your mdb file is located, so it's
    > allowed
    > to read and write to the database.
    >
    > Are you running a secured database ( username/password needed to read it
    > ? )
    > Or just using the admin with no password ?
    >
    >
    >
    > Juan T. Llibre
    > ASP.NET MVP
    > http://asp.net.do/foros/
    > Foros de ASP.NET en Español
    > Ven, y hablemos de ASP.NET...
    > ======================
    >
    > "Nathan Sokalski" <> wrote in message
    > news:...
    >> Thank you for that information, it was definitely an error that would
    >> have caused me problems. However, I am now recieving the following error:
    >>
    >> [OleDbException (0x80004005): The Microsoft Jet database engine cannot
    >> open the file
    >> 'c:\inetpub\wwwroot\WebApplication1\nathansokalski_com.mdb'. It is
    >> already opened exclusively by another user, or you need permission to
    >> view its data.]
    >> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >> System.Data.OleDb.OleDbConnection.Open() +203
    >> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >> ConnectionState& originalState) +44
    >> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    >> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >> CommandBehavior behavior) +304
    >> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    >> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >> CommandBehavior behavior) +77
    >> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
    >> +36
    >> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    >> EventArgs e) in
    >> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs
    >> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >> System.Web.UI.Control.LoadRecursive() +35
    >> System.Web.UI.Page.ProcessRequestMain() +750
    >>
    >> I know it is not opened by another user (including me, because this is
    >> the first thing I did after booting my computer). I tried looking at the
    >> security tab in the properties of nathansokalski_com.mdb, but the only 2
    >> accounts there were mine and SYSTEM (it did not list others like Internet
    >> Guest Account, Launch IIS Process Account, VS Developers, etc.). It is
    >> listed in Visual Studio as part of the Application. What do I need to do
    >> to either the file or my code to be able to use the database? Thanks.
    >> --
    >> Nathan Sokalski
    >>
    >> http://www.nathansokalski.com/
    >>
    >> "Juan T. Llibre" <> wrote in message
    >> news:...
    >>> Try :
    >>>
    >>> PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=
    >>>
    >>> DATA SOURCE is 2 words, not one.
    >>>
    >>>
    >>>
    >>> Juan T. Llibre
    >>> ASP.NET MVP
    >>> http://asp.net.do/foros/
    >>> Foros de ASP.NET en Español
    >>> Ven, y hablemos de ASP.NET...
    >>> ======================
    >>>
    >>> "Nathan Sokalski" <> wrote in message
    >>> news:%23XC%...
    >>>>I am trying to connect to a Microsoft Access Database from my ASP.NET
    >>>>Application. I use the following code to create my connection string:
    >>>>
    >>>> cmdSelect.Connection = New
    >>>> System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE="
    >>>> & Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    >>>>
    >>>>
    >>>> Although the error does not occur until the Fill() method is called:
    >>>>
    >>>> dataadapterSelect.Fill(ratedpoems, "poemratings")
    >>>>
    >>>>
    >>>> I have a feeling the problem is in my connection string, but I do not
    >>>> know what the problem is. The error returned when I try to view the
    >>>> page in my browser is:
    >>>>
    >>>> [OleDbException (0x80004005): Could not find installable ISAM.]
    >>>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>>> System.Data.OleDb.OleDbConnection.Open() +203
    >>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >>>> ConnectionState& originalState) +44
    >>>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    >>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >>>> CommandBehavior behavior) +304
    >>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    >>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >>>> CommandBehavior behavior) +77
    >>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
    >>>> srcTable) +36
    >>>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    >>>> EventArgs e) in
    >>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>>> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs
    >>>> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>>> System.Web.UI.Control.LoadRecursive() +35
    >>>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>>
    >>>>
    >>>> Can someone please help me figure out what I am doing wrong or what my
    >>>> connection string should look like? Thanks.
    >>>> --
    >>>> Nathan Sokalski
    >>>>
    >>>> http://www.nathansokalski.com/
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Nathan Sokalski, Jun 8, 2005
    #5
  6. Right click the folder for which you want to
    grant permissions for, using Windows Explorer.

    Select "Properties", and then click the "Security" tab.
    Click "Add", and then click "Advanced".

    Click "Find Now".
    Scroll down to the "NJS\ASPNET" account

    Assign read, change and write permissions to it.
    OK your way out of the dialog.

    I am assuming that NJS is the computer
    where the nathansokalski_com.mdb is located.

    Is that right ?




    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Nathan Sokalski" <> wrote in message
    news:usai$...
    > When I ran the code you gave me, the account it returned was NJS\ASPNET, which is what I
    > expected, however, that account is not listed under the Security tab for the mdb file or
    > the directory that the mdb file is in (I could not find the account listed for
    > anything). I did notice, however, that the following directory existed on my computer:
    >
    > C:\Documents and Settings\NJS\ASPNET
    >
    > How can I give the account the necessary permissions when it is not listed under the
    > Security tab? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    >> Hi, Nathan.
    >>
    >> Here's a short file you can use to determine
    >> which account ASP.NET is running as :
    >> -----------------
    >> <%@ Page Language="VB" %>
    >> <%@ Import NameSpace = System.Security.Principal %>
    >> <script runat="server">
    >> Sub Page_Load()
    >> Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    >> Label1.Text = tmp
    >> End Sub
    >> </script>
    >> <html>
    >> <head>
    >> <title>WindowsIdentity.GetCurrent.Name()</title>
    >> </head>
    >> <body>
    >> <form id="form1" runat="server">
    >> <div>
    >> <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    >> </div>
    >> </form>
    >> </body>
    >> </html>
    >> -------------
    >>
    >> Run it, and it will tell you the name of the account you need to give read/write
    >> permissions to, for the directory where your mdb file is located, so it's allowed
    >> to read and write to the database.
    >>
    >> Are you running a secured database ( username/password needed to read it ? )
    >> Or just using the admin with no password ?
    >>
    >>
    >>
    >> Juan T. Llibre
    >> ASP.NET MVP
    >> http://asp.net.do/foros/
    >> Foros de ASP.NET en Español
    >> Ven, y hablemos de ASP.NET...
    >> ======================
    >>
    >> "Nathan Sokalski" <> wrote in message
    >> news:...
    >>> Thank you for that information, it was definitely an error that would have caused me
    >>> problems. However, I am now recieving the following error:
    >>>
    >>> [OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file
    >>> 'c:\inetpub\wwwroot\WebApplication1\nathansokalski_com.mdb'. It is already opened
    >>> exclusively by another user, or you need permission to view its data.]
    >>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>> System.Data.OleDb.OleDbConnection.Open() +203
    >>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >>> ConnectionState& originalState) +44
    >>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord,
    >>> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
    >>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32
    >>> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    >>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
    >>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender, EventArgs e) in
    >>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e) in
    >>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>> System.Web.UI.Control.LoadRecursive() +35
    >>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>
    >>> I know it is not opened by another user (including me, because this is the first thing
    >>> I did after booting my computer). I tried looking at the security tab in the
    >>> properties of nathansokalski_com.mdb, but the only 2 accounts there were mine and
    >>> SYSTEM (it did not list others like Internet Guest Account, Launch IIS Process
    >>> Account, VS Developers, etc.). It is listed in Visual Studio as part of the
    >>> Application. What do I need to do to either the file or my code to be able to use the
    >>> database? Thanks.
    >>> --
    >>> Nathan Sokalski
    >>>
    >>> http://www.nathansokalski.com/
    >>>
    >>> "Juan T. Llibre" <> wrote in message
    >>> news:...
    >>>> Try :
    >>>>
    >>>> PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=
    >>>>
    >>>> DATA SOURCE is 2 words, not one.
    >>>>
    >>>>
    >>>>
    >>>> Juan T. Llibre
    >>>> ASP.NET MVP
    >>>> http://asp.net.do/foros/
    >>>> Foros de ASP.NET en Español
    >>>> Ven, y hablemos de ASP.NET...
    >>>> ======================
    >>>>
    >>>> "Nathan Sokalski" <> wrote in message
    >>>> news:%23XC%...
    >>>>>I am trying to connect to a Microsoft Access Database from my ASP.NET Application. I
    >>>>>use the following code to create my connection string:
    >>>>>
    >>>>> cmdSelect.Connection = New
    >>>>> System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE=" &
    >>>>> Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    >>>>>
    >>>>>
    >>>>> Although the error does not occur until the Fill() method is called:
    >>>>>
    >>>>> dataadapterSelect.Fill(ratedpoems, "poemratings")
    >>>>>
    >>>>>
    >>>>> I have a feeling the problem is in my connection string, but I do not know what the
    >>>>> problem is. The error returned when I try to view the page in my browser is:
    >>>>>
    >>>>> [OleDbException (0x80004005): Could not find installable ISAM.]
    >>>>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>>>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>>>> System.Data.OleDb.OleDbConnection.Open() +203
    >>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >>>>> ConnectionState& originalState) +44
    >>>>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord,
    >>>>> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    >>>>> +304
    >>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32
    >>>>> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    >>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
    >>>>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender, EventArgs e) in
    >>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>>>> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e) in
    >>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>>>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>>>> System.Web.UI.Control.LoadRecursive() +35
    >>>>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>>>
    >>>>>
    >>>>> Can someone please help me figure out what I am doing wrong or what my connection
    >>>>> string should look like? Thanks.
    >>>>> --
    >>>>> Nathan Sokalski
    >>>>>
    >>>>> http://www.nathansokalski.com/
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Juan T. Llibre, Jun 8, 2005
    #6
  7. Nathan Sokalski

    Jeff Cochran Guest

    On Tue, 7 Jun 2005 22:01:32 -0400, "Nathan Sokalski"
    <> wrote:

    >When I ran the code you gave me, the account it returned was NJS\ASPNET,
    >which is what I expected, however, that account is not listed under the
    >Security tab for the mdb file or the directory that the mdb file is in (I
    >could not find the account listed for anything). I did notice, however, that
    >the following directory existed on my computer:
    >
    >C:\Documents and Settings\NJS\ASPNET
    >
    >How can I give the account the necessary permissions when it is not listed
    >under the Security tab? Thanks.


    What operating system? Did you add the account?

    Jeff
     
    Jeff Cochran, Jun 8, 2005
    #7
  8. That is correct, NJS is the computer where nathansokalski_com.mdb is
    located.
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    "Juan T. Llibre" <> wrote in message
    news:%...
    > Right click the folder for which you want to
    > grant permissions for, using Windows Explorer.
    >
    > Select "Properties", and then click the "Security" tab.
    > Click "Add", and then click "Advanced".
    >
    > Click "Find Now".
    > Scroll down to the "NJS\ASPNET" account
    >
    > Assign read, change and write permissions to it.
    > OK your way out of the dialog.
    >
    > I am assuming that NJS is the computer
    > where the nathansokalski_com.mdb is located.
    >
    > Is that right ?
    >
    >
    >
    >
    > Juan T. Llibre
    > ASP.NET MVP
    > http://asp.net.do/foros/
    > Foros de ASP.NET en Español
    > Ven, y hablemos de ASP.NET...
    > ======================
    >
    > "Nathan Sokalski" <> wrote in message
    > news:usai$...
    >> When I ran the code you gave me, the account it returned was NJS\ASPNET,
    >> which is what I expected, however, that account is not listed under the
    >> Security tab for the mdb file or the directory that the mdb file is in (I
    >> could not find the account listed for anything). I did notice, however,
    >> that the following directory existed on my computer:
    >>
    >> C:\Documents and Settings\NJS\ASPNET
    >>
    >> How can I give the account the necessary permissions when it is not
    >> listed under the Security tab? Thanks.
    >> --
    >> Nathan Sokalski
    >>
    >> http://www.nathansokalski.com/
    >>
    >> "Juan T. Llibre" <> wrote in message
    >> news:...
    >>> Hi, Nathan.
    >>>
    >>> Here's a short file you can use to determine
    >>> which account ASP.NET is running as :
    >>> -----------------
    >>> <%@ Page Language="VB" %>
    >>> <%@ Import NameSpace = System.Security.Principal %>
    >>> <script runat="server">
    >>> Sub Page_Load()
    >>> Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    >>> Label1.Text = tmp
    >>> End Sub
    >>> </script>
    >>> <html>
    >>> <head>
    >>> <title>WindowsIdentity.GetCurrent.Name()</title>
    >>> </head>
    >>> <body>
    >>> <form id="form1" runat="server">
    >>> <div>
    >>> <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    >>> </div>
    >>> </form>
    >>> </body>
    >>> </html>
    >>> -------------
    >>>
    >>> Run it, and it will tell you the name of the account you need to give
    >>> read/write
    >>> permissions to, for the directory where your mdb file is located, so
    >>> it's allowed
    >>> to read and write to the database.
    >>>
    >>> Are you running a secured database ( username/password needed to read it
    >>> ? )
    >>> Or just using the admin with no password ?
    >>>
    >>>
    >>>
    >>> Juan T. Llibre
    >>> ASP.NET MVP
    >>> http://asp.net.do/foros/
    >>> Foros de ASP.NET en Español
    >>> Ven, y hablemos de ASP.NET...
    >>> ======================
    >>>
    >>> "Nathan Sokalski" <> wrote in message
    >>> news:...
    >>>> Thank you for that information, it was definitely an error that would
    >>>> have caused me problems. However, I am now recieving the following
    >>>> error:
    >>>>
    >>>> [OleDbException (0x80004005): The Microsoft Jet database engine cannot
    >>>> open the file
    >>>> 'c:\inetpub\wwwroot\WebApplication1\nathansokalski_com.mdb'. It is
    >>>> already opened exclusively by another user, or you need permission to
    >>>> view its data.]
    >>>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>>> System.Data.OleDb.OleDbConnection.Open() +203
    >>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >>>> ConnectionState& originalState) +44
    >>>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    >>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >>>> CommandBehavior behavior) +304
    >>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    >>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >>>> CommandBehavior behavior) +77
    >>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
    >>>> srcTable) +36
    >>>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    >>>> EventArgs e) in
    >>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>>> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs
    >>>> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>>> System.Web.UI.Control.LoadRecursive() +35
    >>>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>>
    >>>> I know it is not opened by another user (including me, because this is
    >>>> the first thing I did after booting my computer). I tried looking at
    >>>> the security tab in the properties of nathansokalski_com.mdb, but the
    >>>> only 2 accounts there were mine and SYSTEM (it did not list others like
    >>>> Internet Guest Account, Launch IIS Process Account, VS Developers,
    >>>> etc.). It is listed in Visual Studio as part of the Application. What
    >>>> do I need to do to either the file or my code to be able to use the
    >>>> database? Thanks.
    >>>> --
    >>>> Nathan Sokalski
    >>>>
    >>>> http://www.nathansokalski.com/
    >>>>
    >>>> "Juan T. Llibre" <> wrote in message
    >>>> news:...
    >>>>> Try :
    >>>>>
    >>>>> PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=
    >>>>>
    >>>>> DATA SOURCE is 2 words, not one.
    >>>>>
    >>>>>
    >>>>>
    >>>>> Juan T. Llibre
    >>>>> ASP.NET MVP
    >>>>> http://asp.net.do/foros/
    >>>>> Foros de ASP.NET en Español
    >>>>> Ven, y hablemos de ASP.NET...
    >>>>> ======================
    >>>>>
    >>>>> "Nathan Sokalski" <> wrote in message
    >>>>> news:%23XC%...
    >>>>>>I am trying to connect to a Microsoft Access Database from my ASP.NET
    >>>>>>Application. I use the following code to create my connection string:
    >>>>>>
    >>>>>> cmdSelect.Connection = New
    >>>>>> System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE="
    >>>>>> & Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    >>>>>>
    >>>>>>
    >>>>>> Although the error does not occur until the Fill() method is called:
    >>>>>>
    >>>>>> dataadapterSelect.Fill(ratedpoems, "poemratings")
    >>>>>>
    >>>>>>
    >>>>>> I have a feeling the problem is in my connection string, but I do not
    >>>>>> know what the problem is. The error returned when I try to view the
    >>>>>> page in my browser is:
    >>>>>>
    >>>>>> [OleDbException (0x80004005): Could not find installable ISAM.]
    >>>>>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>>>>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>>>>> System.Data.OleDb.OleDbConnection.Open() +203
    >>>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection
    >>>>>> connection, ConnectionState& originalState) +44
    >>>>>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    >>>>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >>>>>> CommandBehavior behavior) +304
    >>>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    >>>>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    >>>>>> CommandBehavior behavior) +77
    >>>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
    >>>>>> srcTable) +36
    >>>>>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    >>>>>> EventArgs e) in
    >>>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>>>>> WebApplication1.poetry.poemratings.Page_Load(Object sender,
    >>>>>> EventArgs e) in
    >>>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>>>>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>>>>> System.Web.UI.Control.LoadRecursive() +35
    >>>>>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>>>>
    >>>>>>
    >>>>>> Can someone please help me figure out what I am doing wrong or what
    >>>>>> my connection string should look like? Thanks.
    >>>>>> --
    >>>>>> Nathan Sokalski
    >>>>>>
    >>>>>> http://www.nathansokalski.com/
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Nathan Sokalski, Jun 8, 2005
    #8
  9. re:
    > That is correct, NJS is the computer where nathansokalski_com.mdb is located.


    Then the procedure outlined for assigning permissions should work:

    Right click the folder for which you want to
    grant permissions for, using Windows Explorer.

    Select "Properties", and then click the "Security" tab.
    Click "Add", and then click "Advanced".

    Click "Find Now".
    Scroll down to the "NJS\ASPNET" account

    Double-click the account to add it to the ACLs for the folder.

    Assign read, change and write permissions to it. ( checkboxes )
    OK your way out of the dialog.

    Let us know if that works. It should.



    Juan T. Llibre
    ASP.NET MVP
    http://asp.net.do/foros/
    Foros de ASP.NET en Español
    Ven, y hablemos de ASP.NET...
    ======================

    "Nathan Sokalski" <> wrote in message
    news:...
    > That is correct, NJS is the computer where nathansokalski_com.mdb is located.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
    > "Juan T. Llibre" <> wrote in message
    > news:%...
    >> Right click the folder for which you want to
    >> grant permissions for, using Windows Explorer.
    >>
    >> Select "Properties", and then click the "Security" tab.
    >> Click "Add", and then click "Advanced".
    >>
    >> Click "Find Now".
    >> Scroll down to the "NJS\ASPNET" account
    >>
    >> Assign read, change and write permissions to it.
    >> OK your way out of the dialog.
    >>
    >> I am assuming that NJS is the computer
    >> where the nathansokalski_com.mdb is located.
    >>
    >> Is that right ?
    >>
    >>
    >>
    >>
    >> Juan T. Llibre
    >> ASP.NET MVP
    >> http://asp.net.do/foros/
    >> Foros de ASP.NET en Español
    >> Ven, y hablemos de ASP.NET...
    >> ======================
    >>
    >> "Nathan Sokalski" <> wrote in message
    >> news:usai$...
    >>> When I ran the code you gave me, the account it returned was NJS\ASPNET, which is what
    >>> I expected, however, that account is not listed under the Security tab for the mdb
    >>> file or the directory that the mdb file is in (I could not find the account listed for
    >>> anything). I did notice, however, that the following directory existed on my computer:
    >>>
    >>> C:\Documents and Settings\NJS\ASPNET
    >>>
    >>> How can I give the account the necessary permissions when it is not listed under the
    >>> Security tab? Thanks.
    >>> --
    >>> Nathan Sokalski
    >>>
    >>> http://www.nathansokalski.com/
    >>>
    >>> "Juan T. Llibre" <> wrote in message
    >>> news:...
    >>>> Hi, Nathan.
    >>>>
    >>>> Here's a short file you can use to determine
    >>>> which account ASP.NET is running as :
    >>>> -----------------
    >>>> <%@ Page Language="VB" %>
    >>>> <%@ Import NameSpace = System.Security.Principal %>
    >>>> <script runat="server">
    >>>> Sub Page_Load()
    >>>> Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    >>>> Label1.Text = tmp
    >>>> End Sub
    >>>> </script>
    >>>> <html>
    >>>> <head>
    >>>> <title>WindowsIdentity.GetCurrent.Name()</title>
    >>>> </head>
    >>>> <body>
    >>>> <form id="form1" runat="server">
    >>>> <div>
    >>>> <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    >>>> </div>
    >>>> </form>
    >>>> </body>
    >>>> </html>
    >>>> -------------
    >>>>
    >>>> Run it, and it will tell you the name of the account you need to give read/write
    >>>> permissions to, for the directory where your mdb file is located, so it's allowed
    >>>> to read and write to the database.
    >>>>
    >>>> Are you running a secured database ( username/password needed to read it ? )
    >>>> Or just using the admin with no password ?
    >>>>
    >>>>
    >>>>
    >>>> Juan T. Llibre
    >>>> ASP.NET MVP
    >>>> http://asp.net.do/foros/
    >>>> Foros de ASP.NET en Español
    >>>> Ven, y hablemos de ASP.NET...
    >>>> ======================
    >>>>
    >>>> "Nathan Sokalski" <> wrote in message
    >>>> news:...
    >>>>> Thank you for that information, it was definitely an error that would have caused me
    >>>>> problems. However, I am now recieving the following error:
    >>>>>
    >>>>> [OleDbException (0x80004005): The Microsoft Jet database engine cannot open the file
    >>>>> 'c:\inetpub\wwwroot\WebApplication1\nathansokalski_com.mdb'. It is already opened
    >>>>> exclusively by another user, or you need permission to view its data.]
    >>>>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>>>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>>>> System.Data.OleDb.OleDbConnection.Open() +203
    >>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >>>>> ConnectionState& originalState) +44
    >>>>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord,
    >>>>> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    >>>>> +304
    >>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32
    >>>>> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    >>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
    >>>>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender, EventArgs e) in
    >>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>>>> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e) in
    >>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>>>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>>>> System.Web.UI.Control.LoadRecursive() +35
    >>>>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>>>
    >>>>> I know it is not opened by another user (including me, because this is the first
    >>>>> thing I did after booting my computer). I tried looking at the security tab in the
    >>>>> properties of nathansokalski_com.mdb, but the only 2 accounts there were mine and
    >>>>> SYSTEM (it did not list others like Internet Guest Account, Launch IIS Process
    >>>>> Account, VS Developers, etc.). It is listed in Visual Studio as part of the
    >>>>> Application. What do I need to do to either the file or my code to be able to use
    >>>>> the database? Thanks.
    >>>>> --
    >>>>> Nathan Sokalski
    >>>>>
    >>>>> http://www.nathansokalski.com/
    >>>>>
    >>>>> "Juan T. Llibre" <> wrote in message
    >>>>> news:...
    >>>>>> Try :
    >>>>>>
    >>>>>> PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=
    >>>>>>
    >>>>>> DATA SOURCE is 2 words, not one.
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>> Juan T. Llibre
    >>>>>> ASP.NET MVP
    >>>>>> http://asp.net.do/foros/
    >>>>>> Foros de ASP.NET en Español
    >>>>>> Ven, y hablemos de ASP.NET...
    >>>>>> ======================
    >>>>>>
    >>>>>> "Nathan Sokalski" <> wrote in message
    >>>>>> news:%23XC%...
    >>>>>>>I am trying to connect to a Microsoft Access Database from my ASP.NET Application.
    >>>>>>>I use the following code to create my connection string:
    >>>>>>>
    >>>>>>> cmdSelect.Connection = New
    >>>>>>> System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOURCE=" &
    >>>>>>> Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    >>>>>>>
    >>>>>>>
    >>>>>>> Although the error does not occur until the Fill() method is called:
    >>>>>>>
    >>>>>>> dataadapterSelect.Fill(ratedpoems, "poemratings")
    >>>>>>>
    >>>>>>>
    >>>>>>> I have a feeling the problem is in my connection string, but I do not know what
    >>>>>>> the problem is. The error returned when I try to view the page in my browser is:
    >>>>>>>
    >>>>>>> [OleDbException (0x80004005): Could not find installable ISAM.]
    >>>>>>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    >>>>>>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    >>>>>>> System.Data.OleDb.OleDbConnection.Open() +203
    >>>>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    >>>>>>> ConnectionState& originalState) +44
    >>>>>>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord,
    >>>>>>> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
    >>>>>>> +304
    >>>>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32
    >>>>>>> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
    >>>>>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +36
    >>>>>>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender, EventArgs e)
    >>>>>>> in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    >>>>>>> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs e) in
    >>>>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    >>>>>>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    >>>>>>> System.Web.UI.Control.LoadRecursive() +35
    >>>>>>> System.Web.UI.Page.ProcessRequestMain() +750
    >>>>>>>
    >>>>>>>
    >>>>>>> Can someone please help me figure out what I am doing wrong or what my connection
    >>>>>>> string should look like? Thanks.
    >>>>>>> --
    >>>>>>> Nathan Sokalski
    >>>>>>>
    >>>>>>> http://www.nathansokalski.com/
    >>>>>>>
    >>>>>>
    >>>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Juan T. Llibre, Jun 8, 2005
    #9
  10. Nathan Sokalski

    Steve Long Guest

    Nathan,
    when you select the security tab on the folder properties dialog, click on
    the Locations button and select your computer. It should be at the top of
    the list. After you do that, type in ASPNET in the textbox below that and
    click the check Names button. It should find NJS\ASPNET.
    Assuming you are using XP of course.

    Steve

    "Nathan Sokalski" <> wrote in message
    news:usai$...
    > When I ran the code you gave me, the account it returned was NJS\ASPNET,
    > which is what I expected, however, that account is not listed under the
    > Security tab for the mdb file or the directory that the mdb file is in (I
    > could not find the account listed for anything). I did notice, however,

    that
    > the following directory existed on my computer:
    >
    > C:\Documents and Settings\NJS\ASPNET
    >
    > How can I give the account the necessary permissions when it is not listed
    > under the Security tab? Thanks.
    > --
    > Nathan Sokalski
    >
    > http://www.nathansokalski.com/
    >
    > "Juan T. Llibre" <> wrote in message
    > news:...
    > > Hi, Nathan.
    > >
    > > Here's a short file you can use to determine
    > > which account ASP.NET is running as :
    > > -----------------
    > > <%@ Page Language="VB" %>
    > > <%@ Import NameSpace = System.Security.Principal %>
    > > <script runat="server">
    > > Sub Page_Load()
    > > Dim tmp As String = WindowsIdentity.GetCurrent.Name()
    > > Label1.Text = tmp
    > > End Sub
    > > </script>
    > > <html>
    > > <head>
    > > <title>WindowsIdentity.GetCurrent.Name()</title>
    > > </head>
    > > <body>
    > > <form id="form1" runat="server">
    > > <div>
    > > <asp:Label ID="Label1" Runat="server" Text="Label"></asp:Label>
    > > </div>
    > > </form>
    > > </body>
    > > </html>
    > > -------------
    > >
    > > Run it, and it will tell you the name of the account you need to give
    > > read/write
    > > permissions to, for the directory where your mdb file is located, so

    it's
    > > allowed
    > > to read and write to the database.
    > >
    > > Are you running a secured database ( username/password needed to read it
    > > ? )
    > > Or just using the admin with no password ?
    > >
    > >
    > >
    > > Juan T. Llibre
    > > ASP.NET MVP
    > > http://asp.net.do/foros/
    > > Foros de ASP.NET en Español
    > > Ven, y hablemos de ASP.NET...
    > > ======================
    > >
    > > "Nathan Sokalski" <> wrote in message
    > > news:...
    > >> Thank you for that information, it was definitely an error that would
    > >> have caused me problems. However, I am now recieving the following

    error:
    > >>
    > >> [OleDbException (0x80004005): The Microsoft Jet database engine cannot
    > >> open the file
    > >> 'c:\inetpub\wwwroot\WebApplication1\nathansokalski_com.mdb'. It is
    > >> already opened exclusively by another user, or you need permission to
    > >> view its data.]
    > >> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    > >> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    > >> System.Data.OleDb.OleDbConnection.Open() +203
    > >> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
    > >> ConnectionState& originalState) +44
    > >> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    > >> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > >> CommandBehavior behavior) +304
    > >> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    > >> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > >> CommandBehavior behavior) +77
    > >> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String

    srcTable)
    > >> +36
    > >> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    > >> EventArgs e) in
    > >> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    > >> WebApplication1.poetry.poemratings.Page_Load(Object sender, EventArgs
    > >> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42


    > >> System.Web.UI.Control.OnLoad(EventArgs e) +67
    > >> System.Web.UI.Control.LoadRecursive() +35
    > >> System.Web.UI.Page.ProcessRequestMain() +750
    > >>
    > >> I know it is not opened by another user (including me, because this is
    > >> the first thing I did after booting my computer). I tried looking at

    the
    > >> security tab in the properties of nathansokalski_com.mdb, but the only

    2
    > >> accounts there were mine and SYSTEM (it did not list others like

    Internet
    > >> Guest Account, Launch IIS Process Account, VS Developers, etc.). It is
    > >> listed in Visual Studio as part of the Application. What do I need to

    do
    > >> to either the file or my code to be able to use the database? Thanks.
    > >> --
    > >> Nathan Sokalski
    > >>
    > >> http://www.nathansokalski.com/
    > >>
    > >> "Juan T. Llibre" <> wrote in message
    > >> news:...
    > >>> Try :
    > >>>
    > >>> PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=
    > >>>
    > >>> DATA SOURCE is 2 words, not one.
    > >>>
    > >>>
    > >>>
    > >>> Juan T. Llibre
    > >>> ASP.NET MVP
    > >>> http://asp.net.do/foros/
    > >>> Foros de ASP.NET en Español
    > >>> Ven, y hablemos de ASP.NET...
    > >>> ======================
    > >>>
    > >>> "Nathan Sokalski" <> wrote in message
    > >>> news:%23XC%...
    > >>>>I am trying to connect to a Microsoft Access Database from my ASP.NET
    > >>>>Application. I use the following code to create my connection string:
    > >>>>
    > >>>> cmdSelect.Connection = New
    > >>>>

    System.Data.OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATASOUR
    CE="
    > >>>> & Server.MapPath("/WebApplication1/nathansokalski_com.mdb"))
    > >>>>
    > >>>>
    > >>>> Although the error does not occur until the Fill() method is called:
    > >>>>
    > >>>> dataadapterSelect.Fill(ratedpoems, "poemratings")
    > >>>>
    > >>>>
    > >>>> I have a feeling the problem is in my connection string, but I do not
    > >>>> know what the problem is. The error returned when I try to view the
    > >>>> page in my browser is:
    > >>>>
    > >>>> [OleDbException (0x80004005): Could not find installable ISAM.]
    > >>>> System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
    > >>>> System.Data.OleDb.OleDbConnection.InitializeProvider() +57
    > >>>> System.Data.OleDb.OleDbConnection.Open() +203
    > >>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection

    connection,
    > >>>> ConnectionState& originalState) +44
    > >>>> System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
    > >>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > >>>> CommandBehavior behavior) +304
    > >>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32
    > >>>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
    > >>>> CommandBehavior behavior) +77
    > >>>> System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String
    > >>>> srcTable) +36
    > >>>> WebApplication1.poetry.poemratings.SortPoems_Click(Object sender,
    > >>>> EventArgs e) in
    > >>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:68
    > >>>> WebApplication1.poetry.poemratings.Page_Load(Object sender,

    EventArgs
    > >>>> e) in

    c:\inetpub\wwwroot\WebApplication1\poetry\poemratings.aspx.vb:42
    > >>>> System.Web.UI.Control.OnLoad(EventArgs e) +67
    > >>>> System.Web.UI.Control.LoadRecursive() +35
    > >>>> System.Web.UI.Page.ProcessRequestMain() +750
    > >>>>
    > >>>>
    > >>>> Can someone please help me figure out what I am doing wrong or what

    my
    > >>>> connection string should look like? Thanks.
    > >>>> --
    > >>>> Nathan Sokalski
    > >>>>
    > >>>> http://www.nathansokalski.com/
    > >>>>
    > >>>
    > >>>
    > >>
    > >>

    > >
    > >

    >
    >
     
    Steve Long, Jun 8, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Wild
    Replies:
    1
    Views:
    10,980
    Kevin Swarts
    Aug 25, 2003
  2. Bart Schelkens

    Connecting to an Access-database

    Bart Schelkens, Nov 19, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    428
    Bart Schelkens
    Nov 19, 2004
  3. Michael Howes
    Replies:
    2
    Views:
    334
    Michael Howes
    Aug 27, 2008
  4. Michael Howes
    Replies:
    2
    Views:
    692
    Michael Howes
    Aug 27, 2008
  5. Shaun
    Replies:
    3
    Views:
    183
    Jeff Cochran
    Jun 6, 2004
Loading...

Share This Page