PDA

Click to See Complete Forum and Search --> : Access 2.0 Converstion


JR Ewing
Jul 27th, 2000, 05:56 PM
Does anyone know how to programmatically convert an older Access DB to Access 2000, using VB6.




[Edited by JR Ewing on 07-28-2000 at 11:27 AM]

Wolfgang Scholze
Jul 29th, 2000, 01:07 PM
Import the database in Access97.
Import the Programm in VB60.
I convertet four project in the same way and I can remember the following problems.
- The database had a password. (not solved till now)
- VBX-Controls from MicroHelp.
If you have a concret problem, mail it to me.

JR Ewing
Jul 31st, 2000, 11:19 AM
I understand what you're saying, but here's the reason for my question.

I have people who are using my app with Access 2.0. I don't want to leave it up to them to convert the DB to Access 97 or 2000. I'd like to be able to do it programmatically.

Here's what I have so far:
I'm using VB6 with DAO 3.6, because I'm using DAO 3.6 on a Access 2.0 DB I can't perform all the tasks I'd like (i.e. add fields). So I had to change the version type to 3.0 instead of Access 2.0's version of 2.0.

Function ConvertDB()

Dim sTempDB As String
Dim sOldDBVersion As String

Set db = OpenDatabase(sDB, True)
sOldDBVersion = db.Version
db.Close

If sOldDBVersion < "3.6" Then
'Get a new name for working DB.
sTempDB = sDB & "1"

If FileExists(sTempDB) Then
Kill sTempDB
End If

DBEngine.CompactDatabase sDB, _
sTempDB, , dbVersion30

'Delete Old DB and replace with working DB
Kill sDB
FileCopy sTempDB, sDB
Kill sTempDB

End If

End Function

This works fine as far as allowing me to perform the tasks I have, but when I try opening the DB it's still in Access 2.0 and I'd like to be able to convert it to Access 97 or 2000 in my code. I don't know if it can be done, but if you have anymore ideas it'd be appreciated. Thanks again.