[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

ASP.net Ms. Access database connection?

Hello
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"
            ProviderName="System.Data.OleDb"
            ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0; Data Source=|DataDirectory|members.mdb"

All help will be appreciated!
0
grafixgirl
Asked:
grafixgirl
  • 2
1 Solution
 
samtran0331Commented:
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:
http://www.connectionstrings.com/?carrier=access
towards the bottom are some samples
0
 
grafixgirlAuthor Commented:
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
0
 
samtran0331Commented:
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 server....so 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|"....you use some kind of physical path...like 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?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now