How to: Connect to an Access Database Using the AccessDataSource Control
To use the AccessDataSource control to connect to an Access database
Open the page from which you want to connect to an Access database.
Switch to Design view.
From the Data group on the Toolbox, drag an AccessDataSource control onto your page.
If the Smart Tag panel is not displayed, right-click the control and click Show Smart Tag.
In the AccessDataSource Tasks list, click Configure Data Source.
The Configure Data Source wizard is displayed.
In the Choose a Database pane, type or select the path to your Microsoft Access database, which will have .mdb as the file name extension.
We recommend that you store your Access database in the Web site's App_Data folder to ensure that the Web server will not return the .mdb file in response to a Web request. In addition, for local Web sites, Visual Web Developer ensures that the Web server has permissions to read and write files in the App_Data folder. For Web sites on other computers, you will need to set those permissions manually.
In the Configure the Select Statement pane, if you want to use the wizard to create a SQL query, click Specify columns from a table or view and use the options in the pane to configure your query.
To have the wizard generate Insert, Update, and Delete statements based on the Select statement you are creating, click Advanced.
If you want to use the query builder or write your Select query, click Specify a custom SQL statement or stored procedure, click Next, and then write your SQL statement. Click the UPDATE, INSERT, or DELETE tabs to create update statements.
In the Test Query pane, click Test Query to determine whether the query returns the results you want.