1. Open the page for connecting to the access database.
2. Switch to the design view.
3. Drag the accessdatasource control from the "data" group in the toolbox to the page.
4. If the "Smart Tag" panel is not displayed, right-click the control and click "show Smart Tag ".
5. In the "accessdatasource task" list, click "configure data source ". The "configure data source" Wizard is displayed.
6. In the select database pane, type or select the Microsoft Access database path. The database extension is. MDB.
Note: We recommend that you store the ACCESS database in the app_data folder of the website, so that the Web server does not return the. MDB file to respond to Web requests. In addition, for local websites, visual web developer can ensure that the Web server has the right to read and write files in the app_data folder. For websites on other computers, you need to manually set these permissions.
7. Click "Next ".
8. In the "Configure select statements" pane, if you want to use the Wizard to create an SQL query, click "specify columns from tables or views ", use the options in this pane to configure the query.
Note: to allow the Wizard to generate insert, update, and delete statements based on the SELECT statement you have created, click "advanced ".
9. If you want to use the Query Builder or compile a SELECT query, click "specify a custom SQL statement or stored procedure", click "Next", and then write an SQL statement. Click "Update", "insert", or "delete" to create these update statements.
10. Click "Next ".
11. In the test query pane, click test query to determine whether to return the expected results.
12. Click Finish ".
13. You can now bind a Data Control (such as the gridview Control) to the accessdatasource control.