PDA

Click to See Complete Forum and Search --> : Accessing an MDB through ASP.NET


Burrick
Nov 27th, 2003, 03:01 PM
Hi All

I have done some reading, and so far all the errors related to my question deal with not being able to open the MDB Database for reading. The solution being (in most cases) allow access to ASPNET.

My issue is even more fundamental than that. I am using an OleDBConnection object which I have placed on my form. I have selected Microsoft Jet 4.0... as the provider. I have pointed to my file and established a connection to it. (Through the properties page)

However when I run the page and attempt to open the connection I get an exception that reads.

'F:\Inetpub\wwwroot\StatusReports\Data\sr.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. (The path is correct, so that is not the actual issue)

Note: my project resides on our Development IIS server, I have IIS loaded on my Windows 2000 workstation, but currently have it disabled. I have attempted to use \\Servername\... instead of F:\ however it doesn't like that any better.

I originally thought that the path to the file would be relative to the project folder. It seems odd to be using the fully realized drive path name. I have noticed in the other questions posted in this forum, that people have used the local "C:\inetpub\wwwroot\projectfolder\file.mdb" so it appears this is the correct format.

Furthermore, what happens when someone else opens this page (once the database can be connected to). They are not likely to even have a connection to this server let alone use the same Drive letter. This is a little confusing.

nswan
Nov 28th, 2003, 09:33 AM
the path should be relative to where ever you are running IIS, so it should be "c:\innetpub\...." if this is where IIS is installed on your development server.

Burrick
Nov 28th, 2003, 09:48 AM
That's what I thought. Perhaps my development setup isn't as it should be.

I am running Visual Studio .Net on my local workstation. IIS is running on a network server, and is where the project was created. When I used the connection object I had to point to the Access database being opened which was within the project folders but is mapped to drive F: This need to include drive F: is what through me, and seemed odd.

I have since figured out why IIS on my own workstation refused to debug and will run this locally which is likely to resolve the file can't be found issue.

However, the connection string will include ... source=c:\innetpub\wwwroot\project\access.mdb.

The actual IIS is physically on a second harddrive "D:" on the server itsself. Once I copy the project over to the Network IIS so others can access it, won't there be an error due to the difference in drive letters?

nswan
Nov 28th, 2003, 09:53 AM
yeah you'll have to change it to d:. Have you got .net framework installed on your server i pressume?

Burrick
Nov 28th, 2003, 10:38 AM
Thanks for the info, and yes the IIS development server is up to date.