473,385 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 16 '05 #1
2 1555
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 16 '05 #2
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 16 '05 #3

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

Similar topics

2
by: WKC | last post by:
Hi guys, I really have a strange problem that I have no where to look for answer. I have a DTS that generate a text file with data queries from sql server 2K then stores it in a local drive. The...
2
by: Brent | last post by:
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...
6
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a...
2
by: Peter O'Reilly | last post by:
I am experiencing difficulty access a mapped network drive in an ASP.NET application. While using the .Net framework v 1.1 implementation of System.IO.Directory.Exists(), it fails to recognize a...
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
8
by: Kevin D. | last post by:
Please note, I already posted this on the MySQL official forum, but received no response. I thought I'd try again in another location. My apologies to anyone reading this twice... Despite...
17
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
1
by: IainAXA | last post by:
Hi I am having problems connecting to a MS Access Db from C#. If the app and Db sit on the same drive then there is no problem, however if I move the Db to a seperate network drive I get the...
1
by: JoeyNic | last post by:
I am working on an application where a web service (on the web tier) calls another web/gateway service (on the app tier). This then needs to save a file to a UNC share on a file server in our...
3
by: iheartvba | last post by:
Hi, I have a MS Access Database which connects to a separate MS Access back end. The back end is located on a network drive on a peer-to-peer network, if the computer with the back end or front...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.