469,954 Members | 1,722 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Problem connecting to Access on network drive.

Sorry if this is completely newbie, I haven't used Access in a while as my
database.
When I do this it works fine,
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=C:\db2.mdb");

But if I move the same access file to my network drive, it gives me an
invalid path error.
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=I:\db2.mdb");

'I:\db2.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.

This is all running on my local machine. I've tried using the UNC path also,
no luck. Please help.
Nov 22 '05 #1
4 3987
Most likely the default ASPNET user account does not have network security
privileges.
To test this theory, use impersonation to have the web application run under
your user account.
Here's more info:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Brent" <b@b.com> wrote in message
news:10*************@corp.supernews.com...
Sorry if this is completely newbie, I haven't used Access in a while as my
database.
When I do this it works fine,
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=C:\db2.mdb");

But if I move the same access file to my network drive, it gives me an
invalid path error.
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=I:\db2.mdb");

'I:\db2.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.

This is all running on my local machine. I've tried using the UNC path also, no luck. Please help.

Nov 22 '05 #2
Most likely the default ASPNET user account does not have network security
privileges.
To test this theory, use impersonation to have the web application run under
your user account.
Here's more info:
http://msdn.microsoft.com/library/de...ersonation.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Brent" <b@b.com> wrote in message
news:10*************@corp.supernews.com...
Sorry if this is completely newbie, I haven't used Access in a while as my
database.
When I do this it works fine,
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=C:\db2.mdb");

But if I move the same access file to my network drive, it gives me an
invalid path error.
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=I:\db2.mdb");

'I:\db2.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.

This is all running on my local machine. I've tried using the UNC path also, no luck. Please help.

Nov 22 '05 #3
Can you do a File.Exists(@"I:\db2.mdb")? What does it return?
"Brent" <b@b.com> wrote in message
news:10*************@corp.supernews.com...
Sorry if this is completely newbie, I haven't used Access in a while as my
database.
When I do this it works fine,
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=C:\db2.mdb");

But if I move the same access file to my network drive, it gives me an
invalid path error.
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=I:\db2.mdb");

'I:\db2.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.

This is all running on my local machine. I've tried using the UNC path also, no luck. Please help.

Nov 22 '05 #4
Can you do a File.Exists(@"I:\db2.mdb")? What does it return?
"Brent" <b@b.com> wrote in message
news:10*************@corp.supernews.com...
Sorry if this is completely newbie, I haven't used Access in a while as my
database.
When I do this it works fine,
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=C:\db2.mdb");

But if I move the same access file to my network drive, it gives me an
invalid path error.
OleDbConnection connection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0 ;" +

@"Data Source=I:\db2.mdb");

'I:\db2.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.

This is all running on my local machine. I've tried using the UNC path also, no luck. Please help.

Nov 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by WKC | last post: by
2 posts views Thread by Peter O'Reilly | last post: by
17 posts views Thread by Mell via AccessMonster.com | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.