Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
svibuk
Yak Posting Veteran
62 Posts |
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-07-24 : 08:45:15
|
[code] Dim oSQLServer As New SQLDMO.SQLServerDim oBackup As New SQLDMO.BackupDim oRestore As New SQLDMO.RestoreDim BACKUPFILE As StringDim DATABASE As StringBACKUPFILE = "C:\" & ProjectFolder & "\VoiceNet_TemplateBackup.bkp" DATABASE = "VoiceNet_at0000"With oBackup .Files = BACKUPFILE .Database = DATABASE .BackupSetName = "VoiceNet" .BackupSetDescription = "Backup from VB.NET application" .oSQLServer.Connect("NINEL-D246655F1", "timecontroluser", "timecontroluser") .SQLBackup(oSQLServer) End With oSQLServer.DisConnect() [/code]-------------------------R.. |
|
|
svibuk
Yak Posting Veteran
62 Posts |
Posted - 2009-07-24 : 08:50:41
|
i am using thisi amnot getting any error but not getting any backypDim a As SQLDMO.Backup Dim svr As SQLDMO._SQLServer Try a = New SQLDMO.BackupClass() svr = New SQLDMO.SQLServerClass() svr.LoginSecure = False svr.Connect(ServerName, USER_n, pwd) MsgBox("connected successfully") a.Action = SQLDMO.SQLDMO_BACKUP_TYPE.SQLDMOBackup_Database a.Database = dbName a.Files = "c:\backup\" & "databkup" a.BackupSetName = dbName a.BackupSetDescription = "Database backup" a.Initialize = True a.SQLBackup(svr) svr.DisConnect() svr = Nothing Catch ex As Exception 'MessageBox.Show(ex.ToString) End Try |
|
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-07-24 : 08:59:49
|
Dim a As SQLDMO.BackupDim svr As SQLDMO._SQLServerTrya = New SQLDMO.BackupClass()svr = New SQLDMO.SQLServerClass()svr.LoginSecure = Falsesvr.Connect(ServerName, USER_n, pwd)MsgBox("connected successfully")a.Action = SQLDMO.SQLDMO_BACKUP_TYPE.SQLDMOBackup_Databasea.Database = dbNamea.Files = "c:\backup\DatabaseBackup.bkp"a.BackupSetName = dbNamea.BackupSetDescription = "Database backup"a.Initialize = Truea.SQLBackup(svr)svr.DisConnect()svr = NothingCatch ex As Exception'MessageBox.Show(ex.ToString)End Try-------------------------R.. |
|
|
svibuk
Yak Posting Veteran
62 Posts |
Posted - 2009-07-24 : 09:05:16
|
done the samebutthe backup folder is blankhow do i check if its taking the databse or no |
|
|
rajdaksha
Aged Yak Warrior
595 Posts |
Posted - 2009-07-24 : 09:06:54
|
Hican you confirm.. where did you check..local machine or server machine..-------------------------R.. |
|
|
svibuk
Yak Posting Veteran
62 Posts |
Posted - 2009-07-25 : 08:03:57
|
its server& i have given the instance name of the server |
|
|
ayamas
Aged Yak Warrior
552 Posts |
Posted - 2009-07-26 : 07:26:05
|
Try thisa.Files = "\\servername\backup\DatabaseBackup.bkp" |
|
|
|
|
|