Solved: Access 2000 Compile Error

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

jo15765

Thread Starter
Joined
Oct 11, 2011
Messages
307
I keep getting this error on Access 2000 == Invalid or Unqualified Reference. This is the code I am trying to execute:
Code:
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, _
       DestinationFileFormat:=.accdb

       MsgBox "Conversion complete."
    End If
  End If
' Get next MDB.
strDBName = Dir
Loop

End Sub
And the piece of code that is not liking is the DestinationFileFormat:=.acdb. Can someone help please?
 
Joined
Jul 29, 2001
Messages
21,334
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.
 

jo15765

Thread Starter
Joined
Oct 11, 2011
Messages
307
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.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Members online

Top