Solved

Backup through VB

Posted on 2002-03-29
5
222 Views
Last Modified: 2010-05-02
Friends,

I am needing to do backup through VB.
How can I make this for SQL and Access???
I don't want to discharge any file bat and I don't want to configure any job in SQL. I want that VB knife this for me....

I want for all the operating systems...

DenisPaim.
0
Comment
Question by:DenisPaim
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 200 total points
ID: 6905048
For access file, you can simply zip the MDB file.

For SQL Server, this is a bit harder. You will need to use SQL-DMO that will give you objects to do database manipulation.
0
 
LVL 32

Expert Comment

by:bhess1
ID: 6905379
Much depends on exactly what you need.

In SQL SERVER, you can use DMO *or* SQL Statments (BACKUP DATABASE is our friend)

In Access, a FileCopy, or some other procedure that copies the DB, is about all you can do (although a CompactDatabase to a new destination is also possible)
0
 
LVL 1

Expert Comment

by:riaz9
ID: 6906538
'in SQL Server using isqlw, you can add a dump device -- see help on sp_addumpdevice for this

sp_addumpdevice 'disk', 'backup_file_logical_name', 'c:\mssql7\backup\backup_filename'

'from vb, you can use the ADODB.Connection object's Execute function to create the backup


Private Sub cmdBackup_Click()
    cn.Execute "Backup database database_name to backup_file_logical_name with Init"
End Sub

'here i have used the init option to overwrite the backup everytime.


'in Access just like emoreau said you can zip the mdb file or use the FileSystemObject function to copy the file to another location.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7060618
This question appears to be abandoned. A question regarding it will be left in the Community Support
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <emoreau>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7065767
Thanks, emoreau  for your help here.

I have finalized this question, and will monitor it for comments.

Moondancer - EE Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question