Results 1 to 13 of 13

Thread: [Resolved] VB6 & Unrecognized Database Format Access 2003

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Resolved [Resolved] VB6 & Unrecognized Database Format Access 2003

    Hi All,

    I have a VB6 project that I inherited about 3 years ago that I am just trying to maintain. They are legacy programs that does payroll and reporting. The original projects connected to a Access 97 database using DAO. I was able to convert the Access 97 database to Access 2003 with no errors. I updated the visual basic projects changing the reference from DAO 3.51 object library to the DAO 3.6 object library. Once I try to compile and execute the program I receive the Unrecognized Database format error. The database works fine in Access 2003. Is there another reference I should add?

    I just need direction on where to start to look. Because it was programmed with DAO parameters, there is not connection string in the code. There is a directory variable that points to the database.

    Any help is appreciated.
    Debbie H
    Last edited by DebbieH; Dec 11th, 2019 at 01:31 AM.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: VB6 & Unrecognized Database Format Access 2003

    I stopped using DAO a long time ago but am thinking that DAO 3.6 pre dates Access 2003 by a few years. I am not sure if it is compatible. I am wondering why you would convert the DB to 2003 format?

  3. #3
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,129

    Re: VB6 & Unrecognized Database Format Access 2003

    Hi Debbie,

    try it with a Access 2000 Database
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  4. #4
    Frenzied Member
    Join Date
    Dec 2008
    Location
    Melbourne Australia
    Posts
    1,487

    Re: VB6 & Unrecognized Database Format Access 2003

    I currently (only) use Access 97 DBs
    Had a large project that was DAO.
    I kept the Access 97 DBs, and progressively (over a few months) converted my numerous Forms to ADO
    They happily ran beside each other (DAO and ADO) until they were all converted.
    And are still using Access 97 DBs

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: VB6 & Unrecognized Database Format Access 2003

    Access 2000 format should work with DAO 3.6. I can't be sure but I think 3.6 was released at the time of Access 2000 and was required to use the 2000 format. Pretty sure it works with Access 2002 but maybe not with the 2003 version.

  6. #6
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,261

    Re: VB6 & Unrecognized Database Format Access 2003

    Acc2003 and DAO3.6 do work together!
    I'd rather try the following:
    Dump all Data from your "original" Acc97-database
    Create a new Database in Acc2003 from a blank slate.
    recreate your table/Column-Structure
    Import the dump back into the new DB.
    test and debug from VB6
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  7. #7
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: VB6 & Unrecognized Database Format Access 2003

    Access 2000 and Access 2003 both parasitize VB's Jet JET_ENGINETYPE_JET4X format. The private structures they'll embed are different, but the host database they lay their filthy eggs in is the same.

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Re: VB6 & Unrecognized Database Format Access 2003

    Thanks for all of your suggestions. I did try to convert the database to Access 2000 and I still received the unrecognized error. The reason I converted to 2002-2003 database format, was so that I did not have rewrite the vba project. I can read VBA and make minor changes, but cannot make any major changes probably without breaking the code along the way. Yes, currently my users are on Access 97, but they are upgrading to Windows 10 in the next couple of weeks and so this was a good time to update the database. As I mentioned, I inherited this project from a gentleman who passed away really suddenly and I have been trying to maintain.

    I actually have another VB Project that attaches to the same Access database and everything work fine. I was able to compile the project, create a setup.exe, and install it on Windows 10. I just cannot figure out what is different between the two projects that would render the error. I use the same references and everything.

    I know I am looking for a needle in the haystack -- thanks for all of your comments. If there are other that would like to chime in, I am all for it.
    Last edited by DebbieH; Dec 9th, 2019 at 03:14 PM.

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Re: VB6 & Unrecognized Database Format Access 2003

    Thanks for all of your suggestions. I did try to convert the database to Access 2000 and I still received the unrecognized error. The reason I converted to 2002-2003 database format, was so that I did not have rewrite the vba project. I can read VBA and make minor changes, but cannot make any major changes probably without breaking the code along the way. Yes, currently my users are on Access 97, but they are upgrading to Windows 10 in the next couple of weeks and so this was a good time to update the database. As I mentioned, I inherited this project from a gentleman who passed away really suddenly and I have been trying to maintain.

    I actually have another VB Project that attaches to the same Access database and everything work fine. I was able to compile the project, create a setup.exe, and install it on Windows 10. I just cannot figure out what is different between the two projects that would render the error. I use the same references and everything.

    I know I am looking for a needle in the haystack -- thanks for all of your comments. If there are other that would like to chime in, I am all for it.

  10. #10
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: VB6 & Unrecognized Database Format Access 2003

    I just need direction on where to start to look. Because it was programmed with DAO parameters, there is not connection string in the code. There is a directory variable that points to the database.
    look at the project that does work, to find the appropriate connection string, for ADO, i am sure you need to have that or parameters for the connection object
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Re: VB6 & Unrecognized Database Format Access 2003

    Thanks Pete for your suggestion. The VB Project was written in DAO not ADO and there is no connection string. The Project uses variables to connect the database.

  12. #12
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    3,129

    Re: VB6 & Unrecognized Database Format Access 2003

    Quote Originally Posted by DebbieH View Post
    Thanks for all of your suggestions. I did try to convert the database to Access 2000 and I still received the unrecognized error. The reason I converted to 2002-2003 database format, was so that I did not have rewrite the vba project. I can read VBA and make minor changes, but cannot make any major changes probably without breaking the code along the way. Yes, currently my users are on Access 97, but they are upgrading to Windows 10 in the next couple of weeks and so this was a good time to update the database. As I mentioned, I inherited this project from a gentleman who passed away really suddenly and I have been trying to maintain.

    I actually have another VB Project that attaches to the same Access database and everything work fine. I was able to compile the project, create a setup.exe, and install it on Windows 10. I just cannot figure out what is different between the two projects that would render the error. I use the same references and everything.

    I know I am looking for a needle in the haystack -- thanks for all of your comments. If there are other that would like to chime in, I am all for it.
    try this
    create a new VB6 Project and add a Ref. to Microsoft Jet and Replication Objects 2.6 Library

    use a Copy of your Access97 Database and then..
    Code:
    'set Ref. to : Microsoft Jet and Replication Objects 2.6 Library
    
    Option Explicit
    
    
    Private Sub Command1_Click()
    Dim oJro As JRO.JetEngine
    Dim cnn1 As String, cnn2 As String
    Set oJro = New JRO.JetEngine
    
    'convert Access 97
    cnn1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data source=E:\myTest.mdb;" & _
               "Jet OLEDB:Engine Type = 4;" & _
               "Jet OLEDB:Database Password ="
    
    'to Access 2000
    cnn2 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data source=E:\base2000.mdb;" & _
               "Jet OLEDB:Engine Type = 5;" & _
               "Jet OLEDB:Database Password ="
    
    'Compact
    oJro.CompactDatabase cnn1, cnn2
    End Sub
    hth
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  13. #13

    Thread Starter
    Junior Member
    Join Date
    Jun 2015
    Posts
    16

    Re: VB6 & Unrecognized Database Format Access 2003

    I want to thank everyone for all their help. The problem has been solved. On the object (Form) there were references to Data1, Data2, Data3, Data4 up to Data11. These active x data objects pointed to an Access database. Once I changed this one parameter to Access 2000, the project compiled and was able to find the database and display all of the data.

Tags for this Thread

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