Source Code Backup Database
===================================
'* * * * * * * * * * * * * *
'Passing Values
'* * * * * * * * * * * * * *
'nServer_Name = SQL server name
'nDB_Name = Database name
'nDB_Login = Login name
'nDB_Password = Password
'nBack_Dev =Backup device name
'nBack_Set = Backup set name
'nBack_Desc = Backup discription
'Backup device name has to be specified by the SQL ADMIN.
'Which comes under SQL Backup. The name you specified must
'be same as Passing value of backup device name.
'SQL ADMIN can only specify the device type(Tape, HD,...).
'* * * * * * * * * * * * * *
'* * * * * * * * * * * * * *
Option Explicit
Private oSQLServer As SQLDMO.SQLServer
Public Function DB_Backup(ByVal nServer_Name As String, _
ByVal nDB_Name As String, _
ByVal nDB_Login As String, ByVal nDB_Password As String, _
ByVal nBack_Dev As String, ByVal nBack_Set As String, _
ByVal nBack_Desc As String) As Boolean
' nServer_Name = SQL server name
' nDB_Name = Database name
' nDB_Login = Login name
' nDB_Password = Password
' nBack_Dev =Backup device name
' nBack_Set = Backup set name
' nBack_Desc = Backup discription
Dim oBackup As SQLDMO.Backup
On Error GoTo ErrorHandler
Set oBackup = CreateObject("SQLDMO.Backup")
If Connect_SQLDB(nServer_Name, nDB_Login, nDB_Password) Then
oBackup.Devices = "[" & nBack_Dev & "]"
oBackup.Database = nDB_Name
oBackup.BackupSetName = nBack_Set
oBackup.BackupSetDescription = nBack_Desc
oBackup.SQLBackup oSQLServer
oSQLServer.DisConnect
DB_Backup = True
End If
Exit Function
ErrorHandler:
DB_Backup = False
End Function
Private Function Connect_SQLDB(ByVal nServer_Name As String, _
ByVal nDB_Login As String, _
ByVal nDB_Password As String) As Boolean
' nServer_Name = SQL server name
' nDB_Login = Login name
' nDB_Password = Password
Set oSQLServer = CreateObject("SQLDMO.SQLServer")
On Error GoTo ErrorHandler
Connect_SQLDB = False
oSQLServer.Connect nServer_Name, nDB_Login, nDB_Password
Connect_SQLDB = True
Exit Function
ErrorHandler:
oSQLServer.DisConnect
Connect_SQLDB = False
End Function
Friday, July 4, 2008
Related Post
Aplikasi Penggajian Aplikasi Payroll ini dibuat dengan menggunakan C# versi 2008; cocok digunakan untuk pembelajara
Bar & Restourant Nich lagi salah satu program yang mengolah data Bar & restauant....aplikasi ini juga dapat menampi
Membuat Anti VirusKeamanan dalam bekerja dengan menggunakan komputer sebagai sarana mengaplikasikan berbagai pekerjaa
Media PlayerSalah satu program yang digunakan untuk memutar lagu-lagu MP3, silahkan download dan anda dapat mem
Tips and Triks Visual Basic 6.0 Hanya Angka yang bisa di Input dalam TextBoxtPrivate Sub txtNomor_KeyPress(KeyAscii As Integer)If
Memformat Disk dengan VBMungkin ini adalah salah satu program yang sudah tidak di pake lagi dengan perkembagnan tehnologi s
SalesProgram yang mengolah data pengiriman barang, program ini menggunakan database Access dan Visual Ba
Program Koperasi Sederhana------------------------------------------------------------------------------------------------Apl
Unistaller 2002 Aplikasi ini gw dapat tahun 2005, dan merupakan salah satu program kesukaan karena aplikasi ini ba
Cyber Cafe Namanya Cyber Cafe....? wah gw gak bisa lagi jelasin gimana dengan aplikasi ini... ok bro download
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment
Terima Kasih
Click to see the code!
To insert emoticon you must added at least one space before the code.