How do I backup a table to another database with a macro or code?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to put a button on the main switchboard to copy a table from the
current database to a backup database in another location.

Also do I have to tweak Access to see a database on a server to backup to
it? It seems to have difficulty locating the file on the server.

Thanks!
 
This is the basic code to create the table in the mdb specified in strFile:

strTable = "Table1"
strFile = "\\Server1\MyPath\MyFile.mdb"
strSql = "SELECT * INTO [" & strTable & "] IN """ & strFile & _
""" FROM [" & strTable & "];"
dbEngine(0)(0).Execute strSql, dbFailOnError
 
Back
Top