Results 1 to 3 of 3

Thread: Backing up SQL DB

  1. #1

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606

    Backing up SQL DB

    Hi Guys,

    It's been so long since i posted here!

    Anyway, how can i backup an SQL databse with VB?

    Right now I do it manually, i open a new db.mdb, and select insert external data, choose my sql odbc, and it download all my data to an access mdb!

    But i need to do it with code!

    any help is appreciated!

    tx

  2. #2
    Lively Member
    Join Date
    Apr 2002
    Location
    Manchester,UK
    Posts
    94
    If you want to do a real database backup run the following SQL statement through ADO or ODBC

    BACKUP DATABASE <DBNAME>
    TO DISK='C:\dbname.bak'
    WITH INIT

    That will create a backup of the database that can be retored using an equivalent restore statement.

  3. #3

    Thread Starter
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    tx london,

    I forgot to mention that my database is not on my local machine!

    it's at a remote location!

    sorry!

    what i'm thinking so far(which i hope that not my last resort), i to create a mdb with code, then create each table, then download all the data in the respective tables, but...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width