Page 294 - Open Soource Technologies 304.indd
P. 294

Event Driven Programming



















































                                                  Figure 13.7: Data Link Properties Dialog.

                          Now, we need to connect to the database by selecting a database file from your hard disk. For
                          demonstration purpose, we will use the database  BIBLIO.MDB that comes with Visual Basic, as
                          shown in Figure 9.8. The path to this database file is C:\Program Files\Microsoft Visual
                          Studio\VB98\BIBLIO.MDB. This path varies from computers to computers, depending on where
                          you install the file. After selecting the file, you need to test the connection by clicking the Test
                          Connection button at the right bottom of the Data Link Properties dialog. If the connection is
                          successful, a message that says ‘Test Connection Succeeded’ will appear. Click the OK button on
                          the message box to return to the data environment. Now rename connection1 to any name by
                          right-clicking it. For example, you can change it to MyConnection. You may also change the
                          name of DataEnvironment1 to MyDataEnvironment using the Properties window.








                          288                    LOVELY PROFESSIONAL UNIVERSITY
   289   290   291   292   293   294   295   296   297   298   299