1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Access 2000 Compile Error

Discussion in 'Business Applications' started by jo15765, Nov 16, 2011.

Thread Status:
Not open for further replies.
  1. jo15765

    jo15765 Thread Starter

    Oct 11, 2011
    I keep getting this error on Access 2000 == Invalid or Unqualified Reference. This is the code I am trying to execute:
    Option Compare Database
    Option Explicit
    Sub ConvertDb(oldDbPath As String, newDbPath As String)
    'NOTE: Uncomment the line Dim x if you are using the
    'alternative Shell function method listed later in this code.
    'Dim x
    Dim strDBName As String
    Dim strOLDDB As String
    Dim strNewDb As String
    strDBName = Dir(oldDbPath & "\*.MDB")   ' Retrieve the first MDB file entry.
    'Loop though the files in the folder to find MDB files.
    Do While strDBName <> ""
    ' Ignore the current folder and the encompassing folder.
      If strDBName <> "." And strDBName <> ".." Then
        If Right(strDBName, 3) = "mdb" Then
           strOLDDB = oldDbPath & "\" & strDBName
           strNewDb = newDbPath & "\" & strDBName
           Application.ConvertAccessProject _
           SourceFilename:=strOLDDB, _
           DestinationFilename:=strNewDb, _
           MsgBox "Conversion complete."
        End If
      End If
    ' Get next MDB.
    strDBName = Dir
    End Sub
    And the piece of code that is not liking is the DestinationFileFormat:=.acdb. Can someone help please?
  2. Rockn


    Jul 29, 2001
    Access 2000 doesn't know how to create an .accdb. if you out put it to an .mdb file it would probably work. There is no reference library to do the conversion. It is like trying to convert an Access 2000 database to Access 2007, it won't work.
  3. jo15765

    jo15765 Thread Starter

    Oct 11, 2011
    Well shoot, that's what I was trying to do haha!! I was trying to programmatic ally convert an access 2000 database to an access 2007 database. I saw that code on Microsofts website and thought it may work for access 2000 databases as well, but looks like I am wrong.
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1027206

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice