Solved

Backup through VB

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access query that references subform 5 49
using web browser with BING 40 148
How to Add / Edit Windows Menu 4 80
Formula problem with Excel attachment 6 44
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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 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…

737 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