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

Backup SQL database

Status
Not open for further replies.

rdnzl

Programmer
Nov 22, 2002
5
NO
Hi!
In an Access adp file, it's possible to make backup of the SQL database. I would like to do the same from code (VBA/VB6). I've searched the MSDN (and Google), but I haven't found anything.
Anyone here that have a solution for this? (No, the FSO doesn't work either, because the db files are in use.)

TIA
 
From the main menu select Tools | Database Utilities | Backup. You'll be prompted for the name and location of the backup. This only backs up the server databse and objects. You'l need to copy the ADP file, to back it up.

You can also use the SQL Backup command. Th following link to the internet version of SQL BOL provides the complete syntax and examples.

If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
But I would like to write the backup routine in VBA or VB6, is that possible?
 
Here is one way to perform the backup from VBA.\ using the SQL Backup command.

DoCmd.RunSQL ("backup database YourDatabase to disk='\\servername\sqlbackup\YourDatabase.BAK'") If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top