Page 1 of 3 123 LastLast
Results 1 to 15 of 34
  1. #1
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27

    Old Access Database Conversion

    I have an Access database I built over a period of years. I started the database in Access 2.0 and continue to build the database in Access 2003.

    I retired the database almost twenty years ago, but recently I decided to convert it to a more recent version of Access so I can use it again.

    I had a copy of Access 2007 which I installed and used to convert the database from mdb format to accdb format.

    And I am getting errors that I never got before the conversion.

    One problem I've isolated in a function occurs when the line "Set GetPerDb = DBEngine.Workspaces(0).Databases(0)" tries to execute, it generates "Error 13 - Type Mismatch" in the following part of the function:


    Dim GetPerDb As Database
    Dim PersonSet As Recordset

    Set GetPerDb = DBEngine.Workspaces(0).Databases(0)

    I tried substituting the following line, "Set GetPerDb = CurrentDb()" but that only gives the same Error 13.

    Does anyone have any idea what might be causing this?

    When I open the unconverted, mdb, version of the same database in Access 2007, the same line executes without an error.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I cannot replicate issue. If you want to provide mdb file for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Shot in the dark, but I'd try disambiguating the declarations:

    Dim GetPerDb As DAO.Database
    Dim PersonSet As DAO.Recordset
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    I've been away from this for a while, but IIRC, converting an Access app from 32 bit to 64 bit can cause errors. It's been a long time since 2003!

    Also, IIRC, there's a simple method of getting around this, but sadly my old brain can't retrieve it!

    Sorry!

    Linq
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27
    Quote Originally Posted by June7 View Post
    I cannot replicate issue. If you want to provide mdb file for analysis, follow instructions at bottom of my post.
    Thank you, but for certain reasons that would be a last resort.


    I was wondering--some library references in the database are different after Access converted the database from mdb to accdb. If I post the references from the mdb and from the accdb version, do you think comparing the two sets of references might provide a clue?

  6. #6
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27
    Quote Originally Posted by Missinglinq View Post
    I've been away from this for a while, but IIRC, converting an Access app from 32 bit to 64 bit can cause errors. It's been a long time since 2003!

    Also, IIRC, there's a simple method of getting around this, but sadly my old brain can't retrieve it!

    Sorry!

    Linq

    The mdb version runs fine on a 64 bit PC running Windows 7 and Access 32 bit 2003. The mdb version also seems to run fine on a Windows 10 64 bit PC running Access 32 bit 2007.

    But the mdb converted to accdb generates the error on the Windows 10 64 bit PC running Access 32 bit 2007.

  7. #7
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27
    Quote Originally Posted by pbaldy View Post
    Shot in the dark, but I'd try disambiguating the declarations:

    Dim GetPerDb As DAO.Database
    Dim PersonSet As DAO.Recordset

    That worked!!!

    Thanks so much.

    I have tons of code I wrote in this database--would it hurt for me to run find and replace so I can make the same change in all my functions and subs?

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I would, but make a copy first.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27
    Quote Originally Posted by pbaldy View Post
    I would, but make a copy first.
    Sure thing.

    Thanks again!

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Interesting. My code has no issue without the DAO prefix.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by Cosimo View Post
    Sure thing.

    Thanks again!
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by June7 View Post
    Interesting. My code has no issue without the DAO prefix.
    If memory serves that may depend on the order of items in your references, but I could be wrong.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27
    Quote Originally Posted by June7 View Post
    Interesting. My code has no issue without the DAO prefix.
    I didn't have a problem without using DAO either when I ran an mdb version of the same database either on Access 2003 or Access 2007.

    It was only when I converted the database to accdb format and then ran it on Access 2003 that this problem occurred.

    I also added DAO to another function I made years ago that was giving me the same Error 13 when using the accdb format in Access 2007, and now that function is running OK.

    Possibly, this issue goes away with Access 2010.

    Or, as Pbaldy mentioned, it could be you and I have somewhat different library references set (my mdb version and the converted accdb version of the same database, do have somewhat different references--something I will also need to take a close look at).

  14. #14
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27
    Quote Originally Posted by June7 View Post
    Interesting. My code has no issue without the DAO prefix.
    I was skimming through my old notes from twenty+ years ago, and ran across a possible explanation: if in the library references the DAO thing is higher than the ADO thing, Access will treat DAO as the default code.

    That might be why you don't have the problem.

  15. #15
    Cosimo is offline Novice
    Windows 10 Access 2007
    Join Date
    Jan 2024
    Posts
    27
    Quote Originally Posted by pbaldy View Post
    If memory serves that may depend on the order of items in your references, but I could be wrong.
    I just discovered info in my old notes that if DAO is higher that, for example, ADO, then Access treats DAO as the default reference.

    I haven't checked, but I bet the order in my library changed when I converted my database from 2003 to 2007.

    But in any case, I will always use the DAO prefix from now on.

Page 1 of 3 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 10-03-2018, 05:18 PM
  2. Replies: 5
    Last Post: 10-27-2015, 06:00 AM
  3. Replies: 2
    Last Post: 02-11-2014, 07:40 PM
  4. Any program for database conversion
    By drivena in forum Misc
    Replies: 1
    Last Post: 09-28-2013, 08:44 PM
  5. Conversion of database to text format.Help!!
    By sasipulikkal in forum Import/Export Data
    Replies: 3
    Last Post: 09-28-2009, 01:38 AM

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
  •  
Other Forums: Microsoft Office Forums