代码如下
If CN.State = adStateOpen Then CN.Close
CN.ConnectionTimeout = 10
connstr = "Driver={SQL Server};Server=" & xjm & ";UID=" & sa & ";PWD=" & password & ";DATABASE=" & xstgsgl
CN.Open connstr
Nowtime = Format(Now, "hh-mm-ss")
dd = str(Date)
riqi = dd + "-" + NowtimeSql = "BACKUP DATABASE tablename TO disk='D:\BACKUP\xjm" & riqi & "' with noinit"
CN.Execute (Sql)
一执行到cn.execute(sql)时就出现如下提示:
实时错误:[sql-dmo]代码执行异常错误 EXEPTION_ACCESS_VIOLATION到底是为什么有谁能告诉我吗??????
If CN.State = adStateOpen Then CN.Close
CN.ConnectionTimeout = 10
connstr = "Driver={SQL Server};Server=" & xjm & ";UID=" & sa & ";PWD=" & password & ";DATABASE=" & xstgsgl
CN.Open connstr
Nowtime = Format(Now, "hh-mm-ss")
dd = str(Date)
riqi = dd + "-" + NowtimeSql = "BACKUP DATABASE tablename TO disk='D:\BACKUP\xjm" & riqi & "' with noinit"
CN.Execute (Sql)
一执行到cn.execute(sql)时就出现如下提示:
实时错误:[sql-dmo]代码执行异常错误 EXEPTION_ACCESS_VIOLATION到底是为什么有谁能告诉我吗??????
解决方案 »
- 求助~~
- 有答案就加到100分-关于软交换机的问题。
- Vb如何应用IndyTcpServer和IndyTcpClient传送数据?
- 一个工程怎么创建多个窗口啊``
- `
- 窗体属性BorderStyle = 0,在窗体的右下脚,放置一个image控件,如何使用鼠标当拖动image控件时,动态改变窗体的大小?
- 请大家讨论:“应用程序自动升级软件 V1.0”要是用VB写,怎么实现?
- 如何让VB自动使用帐号和密码登录??
- 999999999999999*999999999999999
- 调用程序
- microsoft office excel 2000 vba project password 密码如何解?
- 变速齿轮中有个HOOK.DLL 我想在VB中调用该怎么办?
DISK = N'c:\backup\SendMange' WITH INIT , NOUNLOAD ,
NOSKIP , STATS = 10, NOFORMAT
'执行到bkps.SQLBackup oSQLServer时出错Public WithEvents bkps As SQLDMO.Backup
程序段
Private Sub output2()
Dim oSvr As SQLDMO.SQLServer
Set oSQLServer = CreateObject("SQLDMO.SQLServer")
oSQLServer.LoginSecure = False
oSQLServer.Connect ("(local)"), ("sa"), ("") '连接服务器
Screen.MousePointer = 11
Set bkps = CreateObject("SQLDMO.Backup")
bkps.Database = "SendMange" '指定需备份的数据库
bkps.Action = 0
bkps.Files = "c:\backup\SendMange" '指定备份文件
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
Screen.MousePointer = 0
MsgBox "数据库备份完成"
End Subvb提示
实时错误 '-2147221499 (80040005)
{代码执行异常错误: exception_access_violation