Solved

Backup through VB

Posted on 2002-03-29
5
218 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
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 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