Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Visual C# Database connection string

Posted on 2006-07-08
6
Medium Priority
?
2,570 Views
Last Modified: 2012-08-14
Can some1 plz tell wht wud be the connection string for connecting to a MS Access Database using Visual C# would be.
For some reason I am getting confused with the exact syntax.

Examples of strings would be appreciated
thx
0
Comment
Question by:jhav1594
[X]
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
6 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 500 total points
ID: 17065902
Lots of good information about this and other connection strings at:

http://www.connectionstrings.com/

and also

http://www.dofactory.com/Connect/Connect.aspx#_self9
0
 
LVL 52

Assisted Solution

by:Carl Tawn
Carl Tawn earned 500 total points
ID: 17066101
In its basic form:

      OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=yourdatabase.mdb;");
0
 
LVL 5

Assisted Solution

by:Davidshc76
Davidshc76 earned 500 total points
ID: 17066575
Copy the following Connection string to the Connection string Property of your oleDBConnection Object.. Don't forget to change your Datasource (The path of your Database, and the Username and Password)..

Provider=Microsoft.Jet.OLEDB.4.0;Password="";User ID=Admin;Data Source=DBName.mdb;Mode=ReadWrite|Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False

Make sure that AccessXP is not opened while you are running your application..

Good Luck!
0
 
LVL 15

Assisted Solution

by:Ralf Klatt
Ralf Klatt earned 500 total points
ID: 17069656
Hi,

I'd suggest the following article at Microsoft: http://msdn2.microsoft.com/en-us/library/system.data.common.dbconnectionstringbuilder.aspx

... it'll give you some kind of a variety to chose what you're looking for!


Best regards,
Raisor
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Simple Linear Regression

618 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