Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem connecting to Access Database from ASP.NET Application

Reply
Thread Tools

Problem connecting to Access Database from ASP.NET Application

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-07-2005
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=Micros oft.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(I nt32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e)
in c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      06-07-2005
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" <(E-Mail Removed)> wrote in message
news:%23XC%(E-Mail Removed)...
>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=Micros oft.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(I nt32 hr) +20
> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
> System.Data.OleDb.OleDbConnection.Open() +203
> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection, ConnectionState&
> originalState) +44
> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e) in
> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
> (E-Mail Removed)
> http://www.nathansokalski.com/
>



 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-07-2005
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(I nt32 hr) +20
System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
ConnectionState& originalState) +44
System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e)
in c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
(E-Mail Removed)
http://www.nathansokalski.com/

"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%23XC%(E-Mail Removed)...
>>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=Micros oft.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(I nt32 hr) +20
>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>> System.Data.OleDb.OleDbConnection.Open() +203
>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>> ConnectionState& originalState) +44
>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs
>> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>

>
>



 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      06-07-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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(I nt32 hr) +20
> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
> System.Data.OleDb.OleDbConnection.Open() +203
> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection, ConnectionState&
> originalState) +44
> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e) in
> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:%23XC%(E-Mail Removed)...
>>>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=Micros oft.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(I nt32 hr) +20
>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>> System.Data.OleDb.OleDbConnection.Open() +203
>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>>> ConnectionState& originalState) +44
>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e) in
>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>> (E-Mail Removed)
>>> http://www.nathansokalski.com/
>>>

>>
>>

>
>



 
Reply With Quote
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-08-2005
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
(E-Mail Removed)
http://www.nathansokalski.com/

"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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(I nt32 hr) +20
>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>> System.Data.OleDb.OleDbConnection.Open() +203
>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>> ConnectionState& originalState) +44
>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs
>> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>
>> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:%23XC%(E-Mail Removed)...
>>>>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=Micros oft.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(I nt32 hr) +20
>>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>>> System.Data.OleDb.OleDbConnection.Open() +203
>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>>>> ConnectionState& originalState) +44
>>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs
>>>> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>>> (E-Mail Removed)
>>>> http://www.nathansokalski.com/
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      06-08-2005
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" <(E-Mail Removed)> wrote in message
news:usai$(E-Mail Removed)...
> 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
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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(I nt32 hr) +20
>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>> System.Data.OleDb.OleDbConnection.Open() +203
>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>>> ConnectionState& originalState) +44
>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e) in
>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>> (E-Mail Removed)
>>> http://www.nathansokalski.com/
>>>
>>> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> wrote in message
>>>> news:%23XC%(E-Mail Removed)...
>>>>>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=Micros oft.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(I nt32 hr) +20
>>>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>>>> System.Data.OleDb.OleDbConnection.Open() +203
>>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>>>>> ConnectionState& originalState) +44
>>>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e) in
>>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>>>> (E-Mail Removed)
>>>>> http://www.nathansokalski.com/
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Jeff Cochran
Guest
Posts: n/a
 
      06-08-2005
On Tue, 7 Jun 2005 22:01:32 -0400, "Nathan Sokalski"
<(E-Mail Removed)> 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

 
Reply With Quote
 
Nathan Sokalski
Guest
Posts: n/a
 
      06-08-2005
That is correct, NJS is the computer where nathansokalski_com.mdb is
located.
--
Nathan Sokalski
(E-Mail Removed)
http://www.nathansokalski.com/

"Juan T. Llibre" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:usai$(E-Mail Removed)...
>> 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
>> (E-Mail Removed)
>> http://www.nathansokalski.com/
>>
>> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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(I nt32 hr) +20
>>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>>> System.Data.OleDb.OleDbConnection.Open() +203
>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>>>> ConnectionState& originalState) +44
>>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs
>>>> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>>> (E-Mail Removed)
>>>> http://www.nathansokalski.com/
>>>>
>>>> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> 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" <(E-Mail Removed)> wrote in message
>>>>> news:%23XC%(E-Mail Removed)...
>>>>>>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=Micros oft.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(I nt32 hr) +20
>>>>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>>>>> System.Data.OleDb.OleDbConnection.Open() +203
>>>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection
>>>>>> connection, ConnectionState& originalState) +44
>>>>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>>>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender,
>>>>>> EventArgs e) in
>>>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>>>>> (E-Mail Removed)
>>>>>> http://www.nathansokalski.com/
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      06-08-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> That is correct, NJS is the computer where nathansokalski_com.mdb is located.
> --
> Nathan Sokalski
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> news:usai$(E-Mail Removed)...
>>> 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
>>> (E-Mail Removed)
>>> http://www.nathansokalski.com/
>>>
>>> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> 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" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> 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(I nt32 hr) +20
>>>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>>>> System.Data.OleDb.OleDbConnection.Open() +203
>>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>>>>> ConnectionState& originalState) +44
>>>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e) in
>>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>>>> (E-Mail Removed)
>>>>> http://www.nathansokalski.com/
>>>>>
>>>>> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>>> 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" <(E-Mail Removed)> wrote in message
>>>>>> news:%23XC%(E-Mail Removed)...
>>>>>>>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=Micros oft.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(I nt32 hr) +20
>>>>>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
>>>>>>> System.Data.OleDb.OleDbConnection.Open() +203
>>>>>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
>>>>>>> ConnectionState& originalState) +44
>>>>>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
>>>>>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs e) in
>>>>>>> c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
>>>>>>> (E-Mail Removed)
>>>>>>> http://www.nathansokalski.com/
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Steve Long
Guest
Posts: n/a
 
      06-08-2005
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" <(E-Mail Removed)> wrote in message
news:usai$(E-Mail Removed)...
> 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
> (E-Mail Removed)
> http://www.nathansokalski.com/
>
> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >> 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(I nt32 hr) +20
> >> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
> >> System.Data.OleDb.OleDbConnection.Open() +203
> >> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection connection,
> >> ConnectionState& originalState) +44
> >> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
> >> WebApplication1.poetry.poemratings.Page_Load(Objec t sender, EventArgs
> >> e) in c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
> >> (E-Mail Removed)
> >> http://www.nathansokalski.com/
> >>
> >> "Juan T. Llibre" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >>> 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" <(E-Mail Removed)> wrote in message
> >>> news:%23XC%(E-Mail Removed)...
> >>>>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=Micros oft.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(I nt32 hr) +20
> >>>> System.Data.OleDb.OleDbConnection.InitializeProvid er() +57
> >>>> System.Data.OleDb.OleDbConnection.Open() +203
> >>>> System.Data.Common.DbDataAdapter.QuietOpen(IDbConn ection

connection,
> >>>> ConnectionState& originalState) +44
> >>>> System.Data.Common.DbDataAdapter.FillFromCommand(O bject 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\poemrati ngs.aspx.vb:68
> >>>> WebApplication1.poetry.poemratings.Page_Load(Objec t sender,

EventArgs
> >>>> e) in

c:\inetpub\wwwroot\WebApplication1\poetry\poemrati ngs.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
> >>>> (E-Mail Removed)
> >>>> http://www.nathansokalski.com/
> >>>>
> >>>
> >>>
> >>
> >>

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
Connecting external web application with internal database Big Charles ASP .Net 3 10-29-2006 10:13 AM
Connecting to an Access-database Bart Schelkens ASP .Net 3 11-19-2004 02:29 PM
Problem connecting to Access Database - "already opened exclusively by another user" Tom Wild ASP .Net 1 08-25-2003 06:36 AM



Advertisments