469,591 Members | 1,519 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,591 developers. It's quick & easy.

ASP.NET & Access Database!

I am trying to connect to an Access database on a network drive and
the web server is on the same network, i.e. G:\sample\test.mdb and
everytime I try to connect to it I get an error saying...
'G:\sample\test.mdb' is not a valid path. Make sure that the path name
is spelled correctly and that you are connected to the server on which
the file resides. I then tried giving the full path to the server,
i.e. \\webserver\c:\inetpub\... but got the same error.

When I move the database to my local computer it works fine. Here is
the connection string I am trying to use.

Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=G:\sample\test.mdb;
When I connect via regular ASP using this custom connection string,
everything works correct... any ideas?

"Driver={Microsoft Access Driver (*.mdb)}; Dbq=G:\sample\test.mdb"
Nov 18 '05 #1
3 1494
The default ASPNET user account doesn't have network permissions.
One solution is to change ASP.NET to run under a different account that has
the necessary permissions. For testing purposes I suggest having it run
under your user account since you know you have permission.

For example, you can add a line similar to this to your web.config file:
<identity impersonate="true" userName="domain\MyAppUser">
password="password"/>

Here's more info on impersonation:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"blantz" <br*********@asahq.com> wrote in message
news:18**************************@posting.google.c om...
I am trying to connect to an Access database on a network drive and
the web server is on the same network, i.e. G:\sample\test.mdb and
everytime I try to connect to it I get an error saying...
'G:\sample\test.mdb' is not a valid path. Make sure that the path name
is spelled correctly and that you are connected to the server on which
the file resides. I then tried giving the full path to the server,
i.e. \\webserver\c:\inetpub\... but got the same error.

When I move the database to my local computer it works fine. Here is
the connection string I am trying to use.

Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=G:\sample\test.mdb;
When I connect via regular ASP using this custom connection string,
everything works correct... any ideas?

"Driver={Microsoft Access Driver (*.mdb)}; Dbq=G:\sample\test.mdb"

Nov 18 '05 #2
You have G:\ hardcoded, is the web server have also have the G:\ drive
pointing to the same share? Why not create a DSN on the web server to point
to your Access database? By doing this your code can just point to a DSN
name and not the actual database?

"blantz" wrote:
I am trying to connect to an Access database on a network drive and
the web server is on the same network, i.e. G:\sample\test.mdb and
everytime I try to connect to it I get an error saying...
'G:\sample\test.mdb' is not a valid path. Make sure that the path name
is spelled correctly and that you are connected to the server on which
the file resides. I then tried giving the full path to the server,
i.e. \\webserver\c:\inetpub\... but got the same error.

When I move the database to my local computer it works fine. Here is
the connection string I am trying to use.

Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=G:\sample\test.mdb;
When I connect via regular ASP using this custom connection string,
everything works correct... any ideas?

"Driver={Microsoft Access Driver (*.mdb)}; Dbq=G:\sample\test.mdb"

Nov 18 '05 #3
try to use DSN, and refer to it in your connection string instead of
hardcoding your MDB location path.

HTH,
andy

"blantz" <br*********@asahq.com> wrote in message
news:18**************************@posting.google.c om...
I am trying to connect to an Access database on a network drive and
the web server is on the same network, i.e. G:\sample\test.mdb and
everytime I try to connect to it I get an error saying...
'G:\sample\test.mdb' is not a valid path. Make sure that the path name
is spelled correctly and that you are connected to the server on which
the file resides. I then tried giving the full path to the server,
i.e. \\webserver\c:\inetpub\... but got the same error.

When I move the database to my local computer it works fine. Here is
the connection string I am trying to use.

Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=G:\sample\test.mdb;
When I connect via regular ASP using this custom connection string,
everything works correct... any ideas?

"Driver={Microsoft Access Driver (*.mdb)}; Dbq=G:\sample\test.mdb"

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by cisco | last post: by
3 posts views Thread by Tim Marshall | last post: by
15 posts views Thread by Bart | last post: by
5 posts views Thread by XFER | last post: by
3 posts views Thread by MW de Jager | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.