Results 1 to 18 of 18

Thread: Microsoft Office 2000 conflict

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127

    Question

    I was creating a db program that use an MS Access database to hold the actual information. I started with MS Office 97pro & VB5, and everything was working fine. I picked up Office 2000 and installed it, and when I went to open the databse, it asked me if I wanted to upgrade it, I said sure, figuring it can't hurt (silly me). Now VB won't read the database, it keeps giving the error messege "Unrecognized database format". I thought that upgrading to VB6.0pro would fix it, but as I have done that already, and it still won't read the database. Any ideas on how to get VB to read Access 2000 databases? Thanx.

    Thanx.

    Rick Goodrow


  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    If you're using DAO, make sure that you have version 3.6 selected (check under Project->References).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    I tried that. I found "Microsoft DAO 3.6 Object Library" and checked it. VB required me to uncheck "Microsoft DAO 3.51 Object Library" but whenever I try to run it. I still get the same message. Any other ideas?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    What code are you using to open the DB?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    I'm not specifically using an open command. I just put a database object into the form, and linked it to the file. The first command I use with it is

    'datinv.recordset.movelast'

    to populate it.
    Also, wnen I try to add a new database object and set the databasename to a Access 2000 database, I get the same error message, and can't even select a recordset.

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    That's your problem. Make sure you have the latest version of the DataControl. Although, it's a lot better to use code to open the DB.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Code is Key. Then the DAO 6.0 Library works, if you want code reply. I will give you some DAO Code to open the DB
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    If somebody can give me code for it, that'd be great, but I've never used code to open a database before, so I'll be new at it.

    Also, the other problem is that when I place a data control on the form, then try to adjust the "DatabaseName" property to the Access 2000 file, I get the same error message, and it doesn't work. Could this be a problem with not having the latest Data Control?



    P.S. This may be pushing it, but could somebody also provide a link to the latest Data Control please? (Haven't been on in awhile)

  9. #9
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Sure, add the reference to the DAO 3.60, then:
    Code:
    Dim myDB As Database
    Dim myRS As Recordset
    Dim Records As Integer
    Dim MyText() As String
    Dim i as Integer
    
    Set myDB = DBEngine.Workspaces(0).OpenDatebase("c:\My DB.mdb")
    
    Set myRS = myDB.OpenRecordset("MyRS")
    
    'put code here, i.e.
    myRS.MoveLast
    Records = myRS.RecordCount
    ReDim MyText(Records)
    myRS.MoveFirst
    'to retrive data:
    i = 1
    Do Until myRS.EOF
    i = i + 1
    MyText(i).Text = myRS!Field
    MyRS.MoveNext
    Loop
    
    myRS.Close
    myDB.Close
    
    Set myRS = Nothing
    Set myDB = Nothing
    Note: This is not tested, but it should work!!!

    [Edited by gwdash on 09-18-2000 at 05:02 PM]
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    thanx!

  11. #11
    Fanatic Member gwdash's Avatar
    Join Date
    Aug 2000
    Location
    Minnesota
    Posts
    666
    Oops, i edited something, you must close it all.
    GWDASH
    [b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]

  12. #12

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    but you don't have to close it until the end, right?


  13. #13

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    Okay, I morphed that code into my program, and it uses the Access 2000 databases correctly now.

    Except that another problem popped up. All of my .findfirst commands now say "operation is not supported for this type of object."

    Now the question is how do I replace those commands with working commands that accomplish the same thing.

  14. #14
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    How about .MoveFirst?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    .movefirst works, but the .findfirst doesn't work, which is what I use to search for records.

  16. #16
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    To find records, use:
    Code:
    Set rst = DB.OpenRecordset("SELECT * FROM TheTable WHERE TheField=5")
    rather than opening the table and using .FindFirst.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  17. #17

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    127
    so if I have

    BobDB as a database variable

    CustomerRS as a recordset variable

    and lets say I wanted to find "John" under the [First Name] field in the CustomerRS recordset.

    What would the syntax be?

  18. #18
    Hyperactive Member dsy5's Avatar
    Join Date
    Jul 2000
    Location
    Lockport, NY
    Posts
    362
    Sorry for the intrusion, I am trying to learn how to use databases with VB
    and want to be alerted to the update to this thread.
    Donald Sy - VB (ab)user

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