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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advice about a stand-alone MDE application with export data

Status
Not open for further replies.
Mar 27, 2002
168
NL
I made a stand alone application which I have to distribute to several person.
Normally I make network applications, so split the database in front_end/back_end and relink the tables with a new update.
Now I better like a way to export the tables from the MDE and import after sending a new version
So: Before giving a new version. The old one export to say:
C:\ExportBooks_be.mdb
And after install the new (empty) version, take the import button, select the database and import the tables.
Is this possible? Or is there no way to Export/Import from an MDE file?

Thanx in advance,
gerard
 
You can use:

Code:
DoCmd.TransferDatabase acExport...
to export your tables

Code:
CurrentDB.Execute "DROP TABLE [YourTableNameHere];"
to delete old tables

Code:
DoCmd.TransferDatabase acImport...
to import new tables

The following construct to recreate relationships:
Code:
Dim dbs As Database, rel As Relation, fld As Field
Set dbs = DBEngine(0)(0)
Set rel = dbs.CreateRelation("UserID1", "tblUser", "tblUserAccounts", dbRelationUpdateCascade + dbRelationDeleteCascade)
Set fld = rel.CreateField("UserID")
fld.ForeignName = "UserID"
rel.Fields.Append fld
dbs.Relations.Append rel
dbs.Relations.Refresh

All the components you need are above - you just have to put them together and customise to fit your tables.

Hope this helps.



[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top