I keep getting a error message with this code:
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles backupButton.Click
Dim conn As New ADODB.Connection
'CnStr variable is used to save connection string
Dim CnStr As String
'Sql variable is used to save sql statement
Dim Sql As String
'Initialize connection string
CnStr = "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=master;Data Source=(local)"
'The sql statement is used to backup database
Sql = "Backup EFb to Disk = 'F:\EFB\EFBSave.bak'"
WITH DIFFERENTIAL;
conn.Open(CnStr)
conn.Execute(Sql)
conn.Close()
End Sub
Errors:
ADODB.Connection is not defined
Name "Differential" is not declared
Can anyone help me with this? Thanks in advance
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles backupButton.Click
Dim conn As New ADODB.Connection
'CnStr variable is used to save connection string
Dim CnStr As String
'Sql variable is used to save sql statement
Dim Sql As String
'Initialize connection string
CnStr = "Provider=SQLOLEDB.1;Password=sa;Persist Security Info=True;User ID=sa;Initial Catalog=master;Data Source=(local)"
'The sql statement is used to backup database
Sql = "Backup EFb to Disk = 'F:\EFB\EFBSave.bak'"
WITH DIFFERENTIAL;
conn.Open(CnStr)
conn.Execute(Sql)
conn.Close()
End Sub
Errors:
ADODB.Connection is not defined
Name "Differential" is not declared
Can anyone help me with this? Thanks in advance