Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    2

    Unanswered: VB 6 and Access 2002

    Hi
    I am running Accesss 2002 on XP and VB6. I created a simple form with a data control when I try to open the record source I get an error message saying "unrecognised database format...."
    Can I get VB6 and access 2002 to work together..?

  2. #2
    Join Date
    Jan 2004
    Posts
    184

    Re: VB 6 and Access 2002

    What is your connection string like?

    It should be something like this:

    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''
    'For Standard Security:
    cn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
    "dbq=" & strMDBDatabasePath '& _
    "Uid=admin;" & _
    "Pwd="
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''
    'If you are using a Workgroup (System database):
    cn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
    "dbq=" & strMDBDatabasePath & _
    "SystemDB=c:\somepath\mydb.mdw;", _
    "myUsername", "myPassword"
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''
    'If want to open up the MDB exclusively
    cn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
    "dbq=" & strMDBDatabasePath & _
    "Exclusive=1;" & _
    "Uid=admin;" & _
    "Pwd="
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''
    'If MDB is located on a Network Share
    cn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
    "Dbq=\\myServer\myShare\myPath\myDb.mdb;" & _
    "Uid=admin;" & _
    "Pwd="
    '''''''''''''''''''''''''''''''''''''''''''''''''' ''''

    Also I have been using a control that has made my life easier:

    http://www.geocities.com/scirocco_ha/DataControl.htm

    After selecting the CursorType, CursorLocation, LockType and Disconnected status of your Recordset (there are defaults). I bind my controls and that is it

    Then I can Navigate, Add New, Delete, Refresh, Search and Save Changes to my recordsets without any other code. That is really it, no other code is needed.

    Originally posted by Alroy
    Hi
    I am running Accesss 2002 on XP and VB6. I created a simple form with a data control when I try to open the record source I get an error message saying "unrecognised database format...."
    Can I get VB6 and access 2002 to work together..?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •