SQLDMO.Backup.SQLBackup oSQLServer 出错
VB中:
Public WithEvents bkps As SQLDMO.Backup
Private Sub Command1_Click()
On Error Resume Next
Dim oSvr As SQLDMO.SQLServer
Dim oSQLServer As New SQLDMO.SQLServer
oSQLServer.LoginSecure = False
oSQLServer.Connect ("(local)"), ("sa"), ("") 'Á¬½Ó·þÎñÆ÷
Screen.MousePointer = 11
Set bkps = CreateObject("SQLDMO.Backup")
bkps.Database = "minolta" 'Ö¸¶¨Ð豸·ÝµÄÊý¾Ý¿â
bkps.Action = 0
bkps.Files = Text1.Text & "\db.bak" 'Ö¸¶¨±¸·ÝÎļþ
bkps.Initialize = True
ProgressBar1.Value = 0
ProgressBar1.Max = 100
Screen.MousePointer = 0
DoEvents
Err = 0
bkps.SQLBackup oSQLServer '*********
Screen.MousePointer = 11
ProgressBar1.Value = 100
DoEvents
Set bkps = Nothing
Set oSQLServer = Nothing
Screen.MousePointer = 0
MsgBox "Êý¾Ý¿â±¸·ÝÍê³É"
End Sub
运行到'*********时 出错EXCEPTION_ACCESS_VIOLATION
80040005
数据库是备份出来了 这是怎么回事呀??