Solved Ms. Access database connection?

Posted on 2007-08-01
Last Modified: 2010-08-05
I have switched hosting companies, and previously I had a folder "App_Data", where I had read and write permission. With the new company- they have given us read and write permission to another folder by the name access_db.
I know I need to make changes to the code below, but nothing seems to work

<asp:SqlDataSource ID="ctrlDataSource" runat="server"
            ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|members.mdb"

All help will be appreciated!
Question by:grafixgirl
    LVL 37

    Expert Comment

    check with the host...there are a lot of different ways a host can set up their folders...and this is a common problem so most hosts have a FAQ somewhere about connection strings...
    also have a look at:
    towards the bottom are some samples

    Author Comment

    Connection strings works if I create a folder App_Data and store the .mdb file there. (I tested it)
    so my problem is how to change the following code:
    ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|members.mdb"

    so it looks in to access_db instead of App_Data folder
    LVL 37

    Accepted Solution

    This part is going to change:
    Data Source=|DataDirectory|members.mdb

    the "|DataDirectory|" knows to look in App_Data

    The point I was trying to make in my first post is that there are lots of web hosts and lots of ways to setup a web without knowing what host you're using, it's difficult to tell you what the Data Source path needs to be.

    The link I posted shows you that if you don't use the App_Data folder, then you don't use "|DataDirectory|" use some kind of physical c:\something\something\members.mdb

    but the "\something\something" part can be really different depending on the host and there are different ways to get to "\something\something" (mainly server.mappath)...but it depends on the host...which host are you using?

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    728 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now