Solved

Backup through VB

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

Accepted Solution

by:
Éric Moreau earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
'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 69

Expert Comment

by:Éric Moreau
Comment Utility
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
Comment Utility
Thanks, emoreau  for your help here.

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

Moondancer - EE Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

763 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now