Home > Ask the Microsoft .Net Development Experts > Questions & Answers > How do I set up a connection to an Access database using a SQLConnection?
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

How do I set up a connection to an Access database using a SQLConnection?

Daniel Cazzulino EXPERT RESPONSE FROM: Daniel Cazzulino

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site
>
QUESTION POSED ON: 16 January 2004
How do I set up a connection to a database using a SQLConnection? I want to connect to an Access database in one of my folders, but the dropdown list of where to connect only gives me the name of my computer. What values do I enter to connect and where? Any help would be appreciated.

>
As the name suggests (and the documentation explicitly states), the SqlConnection represents "connection to a SQL Server database." If you're trying to connect to an Access database, you can't use it. You need to use the OleDbConnection, which uses all the drivers that came with the "old" ADO. When you select "New connection" from the dropdown menu for its ConnectionString property, you will get the familiar Data Link dialog. You have to go to the first tab, "Provider", and select the appropriate one for the database you're connecting to, in your case it would be the Microsoft Jet 4.0 (or whichever version you have installed) OLE DB Provider. When you click Next, you will be prompted for the database file and you're set.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Windows Development - White Papers, News and Expert Advice
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts