By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,650 Members | 1,785 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,650 IT Pros & Developers. It's quick & easy.

Problem connecting to Access Database from ASP.NET Application

P: n/a
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
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
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" <nj********@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
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
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 19 '05 #2

P: n/a
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
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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" <nj********@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
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
nj********@hotmail.com
http://www.nathansokalski.com/


Nov 19 '05 #3

P: n/a
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" <nj********@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP10.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\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
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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" <nj********@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
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
nj********@hotmail.com
http://www.nathansokalski.com/



Nov 19 '05 #4

P: n/a
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
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Os*************@TK2MSFTNGP10.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.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" <nj********@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP10.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\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
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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" <nj********@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
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
nj********@hotmail.com
http://www.nathansokalski.com/



Nov 19 '05 #5

P: n/a
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********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP09.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\ASPNET

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

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Os*************@TK2MSFTNGP10.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.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" <nj********@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP10.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\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
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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" <nj********@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
>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
> nj********@hotmail.com
> http://www.nathansokalski.com/
>



Nov 19 '05 #6

P: n/a
On Tue, 7 Jun 2005 22:01:32 -0400, "Nathan Sokalski"
<nj********@hotmail.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\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

Nov 19 '05 #7

P: n/a
That is correct, NJS is the computer where nathansokalski_com.mdb is
located.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP09.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\ASPNET

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

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Os*************@TK2MSFTNGP10.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.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" <nj********@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP10.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\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
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
> 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" <nj********@hotmail.com> wrote in message
> news:%2******************@TK2MSFTNGP15.phx.gbl...
>>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
>> nj********@hotmail.com
>> http://www.nathansokalski.com/
>>
>
>



Nov 19 '05 #8

P: n/a
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********@hotmail.com> wrote in message
news:eq*************@TK2MSFTNGP15.phx.gbl... That is correct, NJS is the computer where nathansokalski_com.mdb is located.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.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********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP09.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\ASPNET

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

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Os*************@TK2MSFTNGP10.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.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" <nj********@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP10.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\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
> nj********@hotmail.com
> http://www.nathansokalski.com/
>
> "Juan T. Llibre" <no***********@nowhere.com> wrote in message
> news:eG**************@TK2MSFTNGP09.phx.gbl...
>> 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" <nj********@hotmail.com> wrote in message
>> news:%2******************@TK2MSFTNGP15.phx.gbl...
>>>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
>>> nj********@hotmail.com
>>> http://www.nathansokalski.com/
>>>
>>
>>
>
>



Nov 19 '05 #9

P: n/a
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********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP09.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\ASPNET

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

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:Os*************@TK2MSFTNGP10.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.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" <nj********@hotmail.com> wrote in message
news:ux**************@TK2MSFTNGP10.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\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
nj********@hotmail.com
http://www.nathansokalski.com/

"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
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" <nj********@hotmail.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
>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
> nj********@hotmail.com
> http://www.nathansokalski.com/
>



Nov 19 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.