This control will allow user to backup SQLServer2000
First time I have problem to make utility for SQLServer2000 Backup.
After reading no of articles i finally made a form for this purpose
But while i started work on my next project i again find problem and i solve it by copy-Paste my existing code and controls to new form.
Then i decided to prepare a user control for this purpose. Now its easy to drag and drop this control on my required form.
Using the code
First make a property for connection string.
Public Property ConnectionString() As String
Set(ByVal value As String)
_ConnectionString = value
Write following code on button click event
Dim conn As New OleDbConnection(_ConnectionString)
Dim cm As New OleDbCommand
cm.CommandText = "backup database master to disk='" & Me.uitxtLocation.Text & "\" & Me.uitxtFileName.Text & ".BAK '"
cm.Connection = conn
MsgBox("Backup done successfully")
Catch ex As Exception
MsgBox("An error occured while taking backup: " & ex.Message)
25-Sep-2008 First upload
25-Sep-2008 Image added