Click here to Skip to main content
16,019,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an access database in my web folder. Let's say in /httpdocs/App_Data/Test.mdb folder. I want to connect to Test.mdb but I am unable to find proper connectionstring to establish a connection and fetch records or perform insert, update and delete operations.
For example take that my
Web server IP Address : 00.00.00.000
Website name : www.xyz.com
Database password : pass

Is there anybody to help me ?? I am new to websites. Please suggest me a proper connectionstring taking the above provided parameters if required.
Posted

Easiest way:
Open Visual Studio.
Open the Server Explorer pane
Right click "Data Connections"
Select "Add Connection..." from the context menu
In the resulting dialog, select your DataSource to "Microsoft Access Database File"
Browse for your database.
Enter your name and password.
Check it all works with teh "Test Connection" button.
Press OK.

Now, back in the Server Explorer pane, expand DataConnections (if you need to) and highlight your database.
In the Properties pane, you will find "Connection string". You can copy and paste this into your program or config file.
 
Share this answer
 
Comments
Babamani 6-Sep-11 10:50am    
Thanks for answering...
But that is not working. My application is on my desktop. But the database is in the web folder. So when I save records, that is not saved in the web folder. Please suggest me any other solutions.
OriginalGriff 6-Sep-11 10:58am    
So connect to the Web Folder version of the DB, not the desktop one...
You can only use Access databases over a network share (UNC path or mapped drive letter). You cannot use an Access database over HTTP, if that's what your'e trying to do.

For examples of connection strings, go to http://www.connectionstrings.com[^].
 
Share this answer
 
Comments
Babamani 6-Sep-11 11:29am    
Then how could I solve this problem ? Please suggest any other way, so that I can use my access database in web server from my desktop application.
Dave Kreskowiak 6-Sep-11 13:04pm    
You either have to add a web service to your web server that handles all database access for outside callers, or get off Access and use a database engine that works over TCP/IP, such as SQL Server Express.

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