1、 英文文献翻译 题 目 : Visual Basic 程序设计课程教学网站的设计与 实现 姓 名 : 学 院 : 计算机与信息工程学院 专 业 : 计算机科学与技术 班 级 : 学 号 : 指 导教师 : 职称 :讲师 Visual Basic Database ConnectivityAn Introductory Guide 1. Create the VB .Net Application Create a blank VB .Net solution in your account and add a newproject to the solution. This should au
2、tomatically create a blankform for you. Also copy the Authors.mdb database file from the COMP315 library folder into your account. 2. Using Data Adapters and Data Sets To manipulate data in an access database you need to use a data adapter to connect to the database and a data set to manipulate the
3、data. 3. Creating the Data Adapter To create a Data Adapter that contains the SQL statement you want to populate the dataset with, do the following: Click on the Data tab in the tool box and then double click on the OleDbDataAdapter control to add it into the form. The Data Adapter Configuration Wiz
4、ard will automatically appear to help you configure the Data Adapter. Figure 1. Location of the Data tab in the toolbox. Click on Next to move to the next screen. Now the Data connection to use box should be blank so click on the New Connection button to configure the new connection. Select the Prov
5、ider tab and then select Microsoft Jet 4.0 OLE DB Provider and then click on Next. In section 1 where it asks for the database to use, click on the button and then navigate to and select the Authors.mdb database and click on the Open button. Leave section 2 as it is. Your screen should look similar
6、to this: Figure 2. Completed Data Link Properties. Click on the Test Connection button and you should get a message saying Test Connection Succeeded. If you dont then check you have followed the instructions above. Click on OK to return to the Data Adapter Wizard and then click on the Next button. M
7、ake sure that Use SQL statements is selected and then click on the Next button. In the large text box type in the following SQL statement: Select * from authors Then click on the Next button and then the Finish button. You may be asked if you want to include a password in the connection string, so j
8、ust click on Dont Include Password. You should now see a new Adapter object and a new Connection object. 4. Creating the Dataset The next step is to create a Dataset class based on the query you specified above. Make sure that your Data Adapter object is selected and at the bottom of the properties pane click on the Generate Dataset link and you should see the window below appear.