Results 1 to 4 of 4

Thread: Help with Access database.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Posts
    118
    Hi
    I am writing a program using MSAccess Database (Office2000)I am getting an error when I choose the recordset.The error states unrecognized database format. What am I doing wrong?
    thanks

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Omaha, Ne
    Posts
    65

    Access 2000

    You have to do it the hard way.

    Change your references to DAO 3.6 and try something like:

    Dim daodb36 As Database
    Dim rs As DAO.Recordset
    Dim strQuery As String
    'set strQuery to table name, query name or SQL string
    strDBPath = "c:\dbpath\dbname.mdb"
    Set daodb36 = DBEngine.OpenDatabase(strDBPath)
    Set rs = daodb36.OpenRecordset(strQuery)


    'Read database

    with rs
    .movefirst
    if !fldname1 <> "NULL" then
    txtbox1.text = !fldname1
    else
    txtbox1.text = " "
    end if

    end with


    There is a web page on MSDN that better explains it but this is what I had to do to code with Office 2000 stuff with VB6. Hopefully VB7 will have the updates.

  3. #3
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    what is the ! used for is that what you have to put in front of the database field name for it to work; just proper syntax?

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Bebe, It's called a "bang" (stupid name if you ask me) and it tells VB that what follows belongs to a collection. In this case, it's pointing back to the recordset "rs".

Posting Permissions

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



Click Here to Expand Forum to Full Width