how to back up tables?

R

rocco

hello,
i use to backup my tables using the adtg format (i.e. adPersistADTG used in
the save method of the ADO recordset).
I would like to build a procedure to recover my data from the tables saved.
Instead of writing lots of ADO code, i was wondering if it is possible to
reference to the table in the .adtg format in SQL.
Is it possible to have something like this working:
INSERT INTO restoredtablename SELECT * FROM current.project.path &
"\backup\savedtablename.adtg"

And if not,
is it possible to have something which can transfer data from tables saved
in .adtg format into the blank tables of the DB using ado? Something
different from having to go record by record, field to field.

I just need to take all records from each tables (adtg) and put them into
the blank access tables.

Thanks,
Rocco
 
G

Graham R Seach

Rocco,

No, but you might be better off saving the table as XML.

Public Sub Backup2XML(sTable As String, _
sTargetXMLFile As String, _
sTargetSchemaFile As String, _
sTargetXSDFile As String)

Application.ExportXML acExportTable, _
sTable, _
sTargetXMLFile, _
sTargetSchemaFile, _
sTargetXSDFile, , acUTF8, 1
End Sub

Public Sub RestoreFromXML(sXMLFile As String)
Application.ImportXML sXMLFile, acAppendData
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
 

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