aspx pages trying to connect to Access MDB Database

Posted on 2005-03-04
Medium Priority
Last Modified: 2006-11-17

Im trying to connect to an access MDB using an aspx page and VB.NET

The application works on my local machine but it wont work once I upload to the webserver

The database connection code is as follows at present

Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\custsupport\database\data.mdb"
        Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)

When I upload to the webserver I change the connection - .....Data Source=custsupport/database/data.mdb

So this fits in with the domain layout = http://www.mydomain.co.uk/custsupport/database/data.mdb

however I keep getting errors from the server as it cant find the file in the path

Error =

'c:\windows\system32\inetsrv\custsupport\database\data.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.

Can anyone help me as I really dont know where to go from here


Question by:KevNet
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 43

Accepted Solution

TimCottee earned 2000 total points
ID: 13457624
Hi KevNet,


Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=" & Server.MapPath("custsupport/database/data.mdb")

This will get the "Real" file location relative to the webserver from the path you have specified.

Tim Cottee

Author Comment

ID: 13457663
Cool - thanks for the help all working now!

Something I will def not forget how to do!

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question