Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert Database

Status
Not open for further replies.

RPW1

Technical User
Jun 14, 2001
19
US
I have various clients that I send databases. Since some use 97 and others use 2000 I am forced to use 97 and the clients that use 2000 need to convert data. They are not computer friendly and is there a way to set up a macro to convert 97 to 2000 placing the 2000 in the same directory each day.

Thank you for any suggestions you may have.

Bob Woods
 
Hi.

Firstly, I would SERIOUSLY make a point of using a test database for this kind of implementation, until you are totally and completely sure that it works properly.

You will have to create a module and a global function. This function can be called from a macro, so automation is possible.

1. Open MSDOS. If you have a network drive (lets say for example that your home directory is U: then go to U: and create a directory called "ScheduledTasks".

2. In this directory (in dos) type :

edit exportdb.bat

3. Now enter the following in :

"C:\Program Files\Microsoft Office\Office2k\msaccess.exe" "U:\my databases\mydatabase.mdb" /excl /User Admin /x ConvAutomationMacro

and save it (note : that was all on one line. change the path for access if you need to. It should point to the msaccess.exe file of your access 2000 installation. Also, make sure that you have a user called Admin in your database). This msdos file is going to be your scheduled task once you have created the macro to export to the 97 version.

I am taking here that you have written the database in access 97 and need to convert to 2000. The problem is that you cannot use Access97 to convert to 2000, but you can use Access 2000 to convert to 97 (although the additional functionality attributed to Access 2000 will be lost!!!).

I am stating that you MUST use Access 2000 for development and convert your database down to 97 rather than the other way round.

If you have access to Access 2000 (no pun intended) then create a module in this database of which you speak and insert this function :

Public Function ConvDB97(Byval DestinationPath as string) as Boolean

Application.ConvertAccessProject _
SourceFilename:=(CurrentProject.Path & "\" & CurrentProject.Name), _
DestinationFilename:=DestinationPath, _
DestinationFileFormat:=acFileFormatAccess97

End Function

'-------------------------

... and save the module. That takes care of that.

Now for the macro.

create a new macro called ConvAutomationMacro.

Add a "RunCode", and for the function name: ConvDB97("fullpathnameofdestdatabase")

where fullpathnameofdestdatabase could be "C:\DBs\MyProj\MyDB97.mdb"

(havent tested, so wouldn't know if spaces would work (eg "C:\My Documents\My Database.mdb") )

Also, Add a "Quit" after it (otherwise you will get the system on screen every time you return to work in the morning (unless thats what you want?!?)

Now save & close the database.

Now try running the batch file I gave earlier. It should
open the database, copy a new Access97 version to the destinationpath, and exit.

If it does then you can go to scheduled tasks in windows control panel and set it up to run the batch file at specific times. I do this all the time, and has saved me many nights of staying at work to do this, instead I just leave my machine on.

Hope this helps. If not, please let me know, I would be glad to be of assistance.

Mr Big.
 
Are you sending them new/modified database stuff (forms, queries, reports etc) or just new data?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top