Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 241
  • Last Modified:

Backup through VB

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
DenisPaim
Asked:
DenisPaim
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
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
 
Brendt HessSenior DBACommented:
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
 
riaz9Commented:
'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
 
Éric MoreauSenior .Net ConsultantCommented:
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
 
MoondancerCommented:
Thanks, emoreau  for your help here.

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

Moondancer - EE Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now