Click here to Skip to main content
16,013,747 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am having problem working with asp .net. I want to use MS asscess file in my project my file in my web folder ~/App_data/myfile.mdb
when I trying to open this file. I am getting message Invalid path.
but I am looking my program looking in c:\...\...\...\myfie.mdb.
which is not correct path.
my oledb code is as follow
myCon = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; User Id=; Password=; Data Source= TFMdb.mdb");

Can any one help me to how to define path in web config.file please
Posted
Comments
TweakBird 15-Nov-10 14:35pm    
see this link : http://www.connectionstrings.com/access

1 solution

Use this in web.config file.
XML
<connectionStrings>
    <add name="conAccess" connectionString="Provider=microsoft.jet.oledb.4.0;data source=|DataDirectory|\Database1.mdb" />

  </connectionStrings>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900