General discussion

  • Creator
    Topic
  • #2291145

    Using Access 2000 and VB 6

    Locked

    by davgordon ·

    I am writting a program using Visual Basic 6. I am trying to read data from an Access 2000 database. I have created a blank form, added the data tool, set the connect property to access, set the DataBase name to point to the database. When I try to set the RecordSource it get an error message “Unrecognizes database format”. Does VB6 recognize Access 2000? I know there was a change from Access 97 to 2000. I have looked in several places, including Microsoft and can not find a list of supported databases. Is this a support issue or am I missing something in the configuration. The database does open with Access, and is quite simple (four tables with no code).

All Comments

  • Author
    Replies
    • #3292777

      Reply To: Using Access 2000 and VB 6

      by julianj ·

      In reply to Using Access 2000 and VB 6

      Well, access 2000 is supported in VB 6. Are you using DAO 3.51 or earlier to code your program? What I mean is that are you using the Data control packaged with VB 6? If you are, it will not work as the “old” data control is using DAO 3.51 and that cannot support access 2000 files.

      To solve this, you can use another data control called the ADO data control. Goto “Project” > “Components” and select MS ADO data control. Or you can read data using program instead of the data control, but you need to import DAO 3.60 library from “Project” > “References”.

      Hope that helps and good luck

      • #3291224

        Reply To: Using Access 2000 and VB 6

        by davgordon ·

        In reply to Reply To: Using Access 2000 and VB 6

        I had it right up until I selected the component. After using the tool tips I found the right component. After that I could see the database. I also unloaded the DAO 3.51 referance and loaded the DAO 3.6 referance.

        Thank you for your time.

    • #3291226

      Reply To: Using Access 2000 and VB 6

      by miss kitty ·

      In reply to Using Access 2000 and VB 6

      Here’s an example of code connecting to an Access database.
      Dim objConn As New ADODB.Connection
      Dim objCmd As New ADODB.Command
      Dim objRS As New ADODB.Recordset
      Dim objParam As ADODB.Parameter
      Dim count As Integer

      ‘set up the database pointer
      objConn.Open “Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=E:\ACCESS\CONTRACT HAULERS\HAULER.mdb;User ID=ADMIN”
      objRS.CursorType = adOpenDynamic
      objRS.LockType = adLockOptimistic

      ‘setting the Active Connection for the command object
      objCmd.ActiveConnection = objConn

      This is using an ADO connection.

      Cathy

    • #3291223

      Reply To: Using Access 2000 and VB 6

      by davgordon ·

      In reply to Using Access 2000 and VB 6

      This question was closed by the author

Viewing 2 reply threads