Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Visual Basic (Microsoft) Databases FAQ

Access 2000/VisData

How do I get VisData to see Access 2000 databases? by jasek78
Posted: 5 Mar 02

   1. Update the DAO Reference from DAO 3.51 to DAO 3.60.
(This step alone is sufficient to allow you to open and work with Access 2000 files.)

         1. Open Visdata.vbp in the Visual Basic design environment.

         2. On the Project menu, open the list of References.

         3. Deselect the existing reference to Microsoft Data Access Objects 3.51, and then locate and select Microsoft Data Access Objects 3.60. If you are using Visual Basic 6.0, be sure to move the DAO 3.6 reference above the ADO library reference in the list.

   2. Add a new menu item and code to allow creating a new Access 2000 database.

         1. Open the main form, frmMDI, in the design environment.

         2. From the Tools menu, open the Menu Editor.

         3. In the Menu Editor window, scroll down in the existing menu items to File / New / Microsoft Access.

         4. In order to insert the new menu item after the existing entry for Access Version 7.0 MDB files, select the following entry: dBase. Click the Insert button, and then click the RIGHT ARROW button to make the new, blank entry a subitem under the Microsoft Access heading. Enter Access 2000 as the Caption and mnuDBNMDB2K as the Name. Close the Menu Editor by clicking OK.

         5. Open the frmMDI code module and select the mnuDBNMDB2K_Click event procedure in the drop-down list. Enter the following line of code:

NewMDB dbVersion40

   3. In Visual Basic 6.0 only, update ADO connection strings to support Access 2000. VisData uses both DAO and ADO. Use the Search function on the Visual Basic Edit menu to locate all references in the project to the Microsoft Jet OLE DB Provider version 3.51 and update 3.51 to 4.0.

   4. In Visual Basic 6.0 only, add code that will enable the Grid toolbar button, which displays a table of records in a DBGrid control rather than one record per form.

         1. Open the module modVisData and find the OpenTable procedure. After the lines:

If gsDataType = gsMSACCESS Then
          .ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & gsDBName

            insert the additional line:

.CursorLocation = adUseClient

         2. Then open frmDataGrid and find the Form_Load event procedure. After the line:

Set datDataCtl.Recordset = mrsFormRecordset

            insert the additional lines:

  Set grdDataGrid.DataSource = datDataCtl

            If you were to omit this step, you might see an empty grid; or the grid may display with the very first cell empty.

   5. Recompile the VISDATA project and copy the compiled executable to the Visual Basic directory (which is \Program Files\Microsoft Visual Studio\Vb98 by default in Visual Basic 6.0).

Back to Visual Basic (Microsoft) Databases FAQ Index
Back to Visual Basic (Microsoft) Databases Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close