473,714 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem connecting to Access Database from ASP.NET Application

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.Conne ction = New
System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE="
& Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
Although the error does not occur until the Fill() method is called:

dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)
+36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e)
in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +750
Can someone please help me figure out what I am doing wrong or what my
connection string should look like? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
9 2194
Try :

PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
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.Conne ction = New
System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE=" &
Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
Although the error does not occur until the Fill() method is called:

dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection, ConnectionState &
originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32 startRecord, Int32
maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32
maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +750
Can someone please help me figure out what I am doing wrong or what my connection string
should look like? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

Nov 19 '05 #2
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\www root\WebApplica tion1\nathansok alski_com.mdb'. It is
already opened exclusively by another user, or you need permission to view
its data.]
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior
behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)
+36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e)
in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +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
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
Try :

PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
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.Conne ction = New
System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE="
& Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
Although the error does not occur until the Fill() method is called:

dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)
+36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs
e) in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +750
Can someone please help me figure out what I am doing wrong or what my
connection string should look like? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/


Nov 19 '05 #3
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.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.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" <nj********@hot mail.com> wrote in message
news:ux******** ******@TK2MSFTN GP10.phx.gbl...
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\www root\WebApplica tion1\nathansok alski_com.mdb'. It is already opened
exclusively by another user, or you need permission to view its data.]
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection, ConnectionState &
originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32 startRecord, Int32
maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32
maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +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
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
Try :

PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
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.Conne ction = New
System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE=" &
Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
Although the error does not occur until the Fill() method is called:

dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32
maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +750
Can someone please help me figure out what I am doing wrong or what my connection
string should look like? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/



Nov 19 '05 #4
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\AS PNET

How can I give the account the necessary permissions when it is not listed
under the Security tab? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:Os******** *****@TK2MSFTNG P10.phx.gbl...
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.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.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" <nj********@hot mail.com> wrote in message
news:ux******** ******@TK2MSFTN GP10.phx.gbl...
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\www root\WebApplica tion1\nathansok alski_com.mdb'. It is
already opened exclusively by another user, or you need permission to
view its data.]
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable)
+36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs
e) in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +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
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
Try :

PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
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.Conne ction = New
System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE="
& Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
Although the error does not occur until the Fill() method is called:

dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String
srcTable) +36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs
e) in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +750
Can someone please help me figure out what I am doing wrong or what my
connection string should look like? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/



Nov 19 '05 #5
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" <nj********@hot mail.com> wrote in message
news:us******** ******@TK2MSFTN GP09.phx.gbl...
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\AS PNET

How can I give the account the necessary permissions when it is not listed under the
Security tab? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:Os******** *****@TK2MSFTNG P10.phx.gbl...
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.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.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" <nj********@hot mail.com> wrote in message
news:ux******** ******@TK2MSFTN GP10.phx.gbl...
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\www root\WebApplica tion1\nathansok alski_com.mdb'. It is already opened
exclusively by another user, or you need permission to view its data.]
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32 startRecord,
Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32
maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +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
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
Try :

PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
>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.Conne ction = New
> System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE=" &
> Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
>
>
> Although the error does not occur until the Fill() method is called:
>
> dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
>
>
> 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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
> System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
> System.Data.Ole Db.OleDbConnect ion.Open() +203
> System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
> ConnectionState & originalState) +44
> System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32 startRecord,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
> +304
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32
> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
> WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender, EventArgs e) in
> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
> WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e) in
> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
> System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
> System.Web.UI.C ontrol.LoadRecu rsive() +35
> System.Web.UI.P age.ProcessRequ estMain() +750
>
>
> Can someone please help me figure out what I am doing wrong or what my connection
> string should look like? Thanks.
> --
> Nathan Sokalski
> nj********@hotm ail.com
> http://www.nathansokalski.com/
>



Nov 19 '05 #6
On Tue, 7 Jun 2005 22:01:32 -0400, "Nathan Sokalski"
<nj********@hot mail.com> 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\AS PNET

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

Nov 19 '05 #7
That is correct, NJS is the computer where nathansokalski_ com.mdb is
located.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
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" <nj********@hot mail.com> wrote in message
news:us******** ******@TK2MSFTN GP09.phx.gbl...
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\AS PNET

How can I give the account the necessary permissions when it is not
listed under the Security tab? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:Os******** *****@TK2MSFTNG P10.phx.gbl...
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.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.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" <nj********@hot mail.com> wrote in message
news:ux******** ******@TK2MSFTN GP10.phx.gbl...
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\www root\WebApplica tion1\nathansok alski_com.mdb'. It is
already opened exclusively by another user, or you need permission to
view its data.]
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String
srcTable) +36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs
e) in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +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
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
> Try :
>
> PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
> news:%2******** **********@TK2M SFTNGP15.phx.gb l...
>>I am trying to connect to a Microsoft Access Database from my ASP.NET
>>Applicati on. I use the following code to create my connection string:
>>
>> cmdSelect.Conne ction = New
>> System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE="
>> & Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
>>
>>
>> Although the error does not occur until the Fill() method is called:
>>
>> dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
>>
>>
>> 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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
>> System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
>> System.Data.Ole Db.OleDbConnect ion.Open() +203
>> System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection
>> connection, ConnectionState & originalState) +44
>> System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
>> CommandBehavior behavior) +304
>> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
>> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
>> CommandBehavior behavior) +77
>> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String
>> srcTable) +36
>> WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
>> EventArgs e) in
>> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
>> WebApplication1 .poetry.poemrat ings.Page_Load( Object sender,
>> EventArgs e) in
>> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
>> System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
>> System.Web.UI.C ontrol.LoadRecu rsive() +35
>> System.Web.UI.P age.ProcessRequ estMain() +750
>>
>>
>> Can someone please help me figure out what I am doing wrong or what
>> my connection string should look like? Thanks.
>> --
>> Nathan Sokalski
>> nj********@hotm ail.com
>> http://www.nathansokalski.com/
>>
>
>



Nov 19 '05 #8
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" <nj********@hot mail.com> wrote in message
news:eq******** *****@TK2MSFTNG P15.phx.gbl... That is correct, NJS is the computer where nathansokalski_ com.mdb is located.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
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" <nj********@hot mail.com> wrote in message
news:us******** ******@TK2MSFTN GP09.phx.gbl...
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\AS PNET

How can I give the account the necessary permissions when it is not listed under the
Security tab? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:Os******** *****@TK2MSFTNG P10.phx.gbl...
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.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.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" <nj********@hot mail.com> wrote in message
news:ux******** ******@TK2MSFTN GP10.phx.gbl...
> 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\www root\WebApplica tion1\nathansok alski_com.mdb'. It is already opened
> exclusively by another user, or you need permission to view its data.]
> System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
> System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
> System.Data.Ole Db.OleDbConnect ion.Open() +203
> System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
> ConnectionState & originalState) +44
> System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32 startRecord,
> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
> +304
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32
> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
> WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender, EventArgs e) in
> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
> WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e) in
> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
> System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
> System.Web.UI.C ontrol.LoadRecu rsive() +35
> System.Web.UI.P age.ProcessRequ estMain() +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
> nj********@hotm ail.com
> http://www.nathansokalski.com/
>
> "Juan T. Llibre" <no***********@ nowhere.com> wrote in message
> news:eG******** ******@TK2MSFTN GP09.phx.gbl...
>> Try :
>>
>> PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
>> news:%2******** **********@TK2M SFTNGP15.phx.gb l...
>>>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.Conne ction = New
>>> System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU RCE=" &
>>> Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
>>>
>>>
>>> Although the error does not occur until the Fill() method is called:
>>>
>>> dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
>>>
>>>
>>> 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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
>>> System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
>>> System.Data.Ole Db.OleDbConnect ion.Open() +203
>>> System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
>>> ConnectionState & originalState) +44
>>> System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32 startRecord,
>>> Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
>>> +304
>>> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32 startRecord, Int32
>>> maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
>>> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
>>> WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender, EventArgs e)
>>> in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
>>> WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs e) in
>>> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42
>>> System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
>>> System.Web.UI.C ontrol.LoadRecu rsive() +35
>>> System.Web.UI.P age.ProcessRequ estMain() +750
>>>
>>>
>>> Can someone please help me figure out what I am doing wrong or what my connection
>>> string should look like? Thanks.
>>> --
>>> Nathan Sokalski
>>> nj********@hotm ail.com
>>> http://www.nathansokalski.com/
>>>
>>
>>
>
>



Nov 19 '05 #9
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" <nj********@hot mail.com> wrote in message
news:us******** ******@TK2MSFTN GP09.phx.gbl...
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\AS PNET

How can I give the account the necessary permissions when it is not listed
under the Security tab? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:Os******** *****@TK2MSFTNG P10.phx.gbl...
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.Nam e()
Label1.Text = tmp
End Sub
</script>
<html>
<head>
<title>WindowsI dentity.GetCurr ent.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" <nj********@hot mail.com> wrote in message
news:ux******** ******@TK2MSFTN GP10.phx.gbl...
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\www root\WebApplica tion1\nathansok alski_com.mdb'. It is
already opened exclusively by another user, or you need permission to
view its data.]
System.Data.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
System.Data.Ole Db.OleDbConnect ion.Open() +203
System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,
ConnectionState & originalState) +44
System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +304
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) +77
System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String srcTable) +36
WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
EventArgs e) in
c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs
e) in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42 System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
System.Web.UI.C ontrol.LoadRecu rsive() +35
System.Web.UI.P age.ProcessRequ estMain() +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
nj********@hotm ail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:eG******** ******@TK2MSFTN GP09.phx.gbl...
Try :

PROVIDER=Micros oft.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" <nj********@hot mail.com> wrote in message
news:%2******** **********@TK2M SFTNGP15.phx.gb l...
>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.Conne ction = New
> System.Data.Ole Db.OleDbConnect ion("PROVIDER=M icrosoft.Jet.OL EDB.4.0;DATASOU R
CE="> & Server.MapPath( "/WebApplication1/nathansokalski_ com.mdb"))
>
>
> Although the error does not occur until the Fill() method is called:
>
> dataadapterSele ct.Fill(ratedpo ems, "poemrating s")
>
>
> 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.Ole Db.OleDbConnect ion.ProcessResu lts(Int32 hr) +20
> System.Data.Ole Db.OleDbConnect ion.InitializeP rovider() +57
> System.Data.Ole Db.OleDbConnect ion.Open() +203
> System.Data.Com mon.DbDataAdapt er.QuietOpen(ID bConnection connection,> ConnectionState & originalState) +44
> System.Data.Com mon.DbDataAdapt er.FillFromComm and(Object data, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior) +304
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, Int32
> startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
> CommandBehavior behavior) +77
> System.Data.Com mon.DbDataAdapt er.Fill(DataSet dataSet, String
> srcTable) +36
> WebApplication1 .poetry.poemrat ings.SortPoems_ Click(Object sender,
> EventArgs e) in
> c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:68
> WebApplication1 .poetry.poemrat ings.Page_Load( Object sender, EventArgs> e) in c:\inetpub\wwwr oot\WebApplicat ion1\poetry\poe mratings.aspx.v b:42> System.Web.UI.C ontrol.OnLoad(E ventArgs e) +67
> System.Web.UI.C ontrol.LoadRecu rsive() +35
> System.Web.UI.P age.ProcessRequ estMain() +750
>
>
> Can someone please help me figure out what I am doing wrong or what my> connection string should look like? Thanks.
> --
> Nathan Sokalski
> nj********@hotm ail.com
> http://www.nathansokalski.com/
>



Nov 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4237
by: Barb | last post by:
Hi there, I sincerely hope that someone out there can help. I have two instances of the SQL 2000 Desktop Engine running. One is on my local machine for development and the other is on another machine on our network which is the production environment. I have built an Access 2003 front end application which connects to this database. This works fine locally, as you would expect. I successfully installed the database on the...
4
3573
by: Dave | last post by:
Hey guys, I have an ODBC problem that has me stumped. I wrote a VBA script to run in Microsoft Excel that pulls data out of an application using that application's ODBC driver and puts it into Excel. I am trying to translate the same program over to Microsoft Access and I ran into a problem. Access locks up if the data I am querying for is not present in the database. To retrieve data from the database of the application, my Excel...
1
3484
by: Tom Wild | last post by:
Hi I am trying to create a webform that connects to an Access database. If I use the connection string: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Gizmo\Gizmo.mdb" Then the application connects to the database and downloads data fine but when I try to fire an Update command I get the following error: "Problem firing System.Data.OleDb.OleDbCommand - Operation must use an updateable query"
3
1502
by: Jay | last post by:
Hello, I have Windows Forms application which uses MS Access Database and a Pocket PC application which uses Datasets, Iam trying to pass Datasets between these applications using WebServices. Both these applications are shrink wrapped so they need to perform with little user configuration WebService/IIS is running on the computer having the Windows Application and Pocket PC connectss to the webservice through Active Sync.
12
2785
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed both the iis and sql server in a single machine. Not too long ago, the machine had some hardware problems, and management has decided to purchase new servers, for both asp.net and sql server.
14
4816
by: Nick Gilbert | last post by:
Hi, I have an asp.net application which runs from a CD-ROM using Cassini. As such, it is single user only. The application connects to an Access database when it is loaded, and keeps the same connection open all the time (as it's single user, this shouldn't be a problem). There is logic in the code to ensure that the connection is
1
1896
by: Chris Love | last post by:
I have already asked this, but no one seems to know the answer. Here is the timeline. I wanted to use the membership/roles functionality in a site. I got all sorts of errors trying to get this setup on the site through the admin interface. So I yanked it out of the application since it did not work. Now everytime I load the site after changing the application I get this error message. If I simply refresh the page, everything works...
2
1742
by: shapper | last post by:
Hello, I added some profile properties to my web.config file. Then I started to use my profile properties in a page class and I get an error: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote
2
4121
by: Patrick F | last post by:
Hi, i have SQL Server 2005 and a database set that is called, myCompany the problem is that i cant connect from my page to it, here is from the web.config: ( i have got this connectionstring from my sqldataobject on my page) <add name="ConStr" connectionString="Data Source=localhost;Initial Catalog=myCompany;Integrated Security=True" providerName="System.Data.SqlClient" /> the strange part is that its trying to connect to a SQL express...
2
3042
by: orandov | last post by:
Hi, I am having a problem connecting my .net applications from the application server to the database server. When I run the application from my windows xp (sp2) box it works fine. When I try to connect via SQL Management Studio to the database server from the application server I get the same error. Here is the error:
0
8801
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9174
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9074
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7953
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4464
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3158
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2520
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.