Help with converting an Access 2002 MDB to an MDE using VB6
Posted on 2004-08-30
I am having a problem converting MS Access *.mdb files into *.mde files using Visual Basic 6. I am still fairly new to VB6 and I found some code on the web after a LOT of searching, so please bear with me....
I created a console VB application that takes an input *.mdb file and generates the *.mde output file. The main lines of code that do the conversion are as follows:
Dim x As Object
Dim strFileIn As String
Dim strFileOut As String
' I gave the strings some absolute file paths
Set x = CreateObject("Access.Application")
x.SysCmd 603, strFileIn, strFileOut
Now, this works perfectly for *.mdb files when I have MS Access 97 installed on the machine. I tried to run this on a machine that has MS Access 2002 installed, and this didn't work. It didn't give me an error, it just did not do anything.
Now, I need this to be a console based application (does NOT have to be VB6). I am going to write a batch file that will call the executable for my application because I need to do this often for many files.
I tried doing the same thing in a VBScript file (*.vbs), and calling "cscript.exe" to do the conversion but again, I had the same problem. The script worked perfectly on my Access 97 machine, but did not do anything on my Access 2002 machine.
I also made sure that my input mdb file was created with MS Access 2002 on my Access 2002 machine.
Does anyone know what I am doing wrong or what I can do to fix this problem?