[VB] Convert programmatically for 97 to 2002 with runtime only

T

termoPilucco

Hello, i have a problem instancing Access Application;
this code segment create a new instance of Access (2002 in my case) and
convert an old database in 2002 format.

Dim XpApp As Access.Application
Set XpApp = New Access.Application
XpApp.Visible = False
Call XpApp.ConvertAccessProject(strSrcDb, strDestDb, acFileFormatAccess2002)
XpApp.Quit
set XpApp= nothing

It works fine for me because i have Access 2002 application installed.
The problem is my client dont have the entire application installed, but
only the runtime.
So i get aoutmation error as the code reach the line "Set XpApp = New
Access.Application"

I know MS sugget this code to convert mdb to a 2002 format:
x = Shell("C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE " &
Chr(34) _
& strOLDDB & Chr(34) & " /Convert " & Chr(34) & strNewDb & Chr(34))
But i dont like the idea.

Can Anyone help me?
thanks and sorry for barbaric english,
termoPilucco
 
T

termoPilucco

"termoPilucco" ha scritto nel messaggio:
I know MS sugget this code to convert mdb to a 2002 format:
x = Shell("C:\Program Files\Microsoft Office\Office10\MSACCESS.EXE "
& Chr(34) _
& strOLDDB & Chr(34) & " /Convert " & Chr(34) & strNewDb &
Chr(34))

Edit:
this code (with some correction to synchronize the result) works on runtime
environment but:
-Runtime interface is showed up and it ask user for a confirmation
-Conversion format is implicit, so i am not sure if mdb result in either
2000 or 2002 format (infact in my test with Access 2002 runtime any
conversion go to 2000 format).

There are any other way to convert programmatically for 97 to 2002 with
runtime only (or using DAO/ADO and VB6)

thanks and sorry for barbaric english,
termoPilucco
 
D

david epsom dot com dot au

Send him a small mdb.
Tell him to double click on the mdb.
Put an autoexec macro in the small mdb.
In the autoexec macro run the Convert Access Project action.

If the location of the Source and Destination is unknown,
you will have to put a form/code etc in your small mdb.


or
Set XpApp = New Access.Application

When using the runtime, you always need an mdb:
Set XpApp = GetObject("dummydb_2.mdb")

call XpApp.Convert...........


(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top