INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

VB6 - DMO - MSSQL DATABASE BACKUP

VB6 - DMO - MSSQL DATABASE BACKUP

(OP)
To create backup thru VB6 I am using following code and facing problem.

Dim BACKUP As New SQLDMO.Backup2
Dim SERVER As New SQLDMO.SQLServer2

Private Sub Command3_Click()
On Error Resume Next
Dim oDevice As New SQLDMO.BackupDevice

With oDevice
.Type = SQLDMODevice_DiskDump
.Name = "ICNOR08DBakUp"
.PhysicalLocation = "C:\share\BACKUP.bak"
End With

SERVER.Connect "ACC-SQL", "sa", "123"
SERVER.BackupDevices.Add oDevice
BACKUP.Action = SQLDMOBackup_Database
BACKUP.Database = "ICNOR08D"
BACKUP.Devices = "ICNOR08DBakUp"
BACKUP.BackupSetDescription = "Full BackUp"
BACKUP.BackupSetName = "By Rashid"

Call BACKUP.SQLBackup(SERVER)

End Sub

My problem is that the code runs well but does not generate desired .bak file.
Where I am making mistake?

RE: VB6 - DMO - MSSQL DATABASE BACKUP

Stupid question.
but why do it via sqldmo?

Much easier to just execute this via a connection.

(I played with dmo a few years ago, but could never do things as easily as if I just sent the server a command.
 With the exception being see a server that wasn't running.)

Rob


 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close