Dim sFile As String
sFile = "N_1"
Dim oServer As New SQLDMO.SQLServer
Dim oDatabase As New SQLDMO.Database
Dim oRestore As New SQLDMO.Restore
oServer.Connect ServerName, UserName, Password
With oRestore
.Files = sFile
.Database = "Northwind"
.ReplaceDatabase = True
.SQLRestore oServer
End With
Set oRestore = Nothing
Set oDatabase = Nothing
oServer.DisConnect
Set oServer = Nothing
MsgBox ("OK")
sFile = "N_1"
Dim oServer As New SQLDMO.SQLServer
Dim oDatabase As New SQLDMO.Database
Dim oRestore As New SQLDMO.Restore
oServer.Connect ServerName, UserName, Password
With oRestore
.Files = sFile
.Database = "Northwind"
.ReplaceDatabase = True
.SQLRestore oServer
End With
Set oRestore = Nothing
Set oDatabase = Nothing
oServer.DisConnect
Set oServer = Nothing
MsgBox ("OK")
解决方案 »
- 刚刚面试了,紧张中....
- 如何在FORM 面实现一个矩形区域
- 做了一个计算机,但是只可以以鼠标点击数字输入,不可以以键盘输入,应该怎么解决?
- cdate,cstr,cint是什么函数啊?
- 高分求listview 及 treeview的用法详解
- 用VB生成OCX文件提示:Permission denied:“d:/toexecel/excel.ocx”,如何解决?
- 最近计算机三级忙死我了,也好久没来了,各位都还好吗?散分。。。
- 我现在在一家IT媒体工作,曾经负责开发了多个C/S数据库系统,想找一份VB程序员的工作,请大家帮帮忙:)
- &&&&&请教高手如何通过编程设置SQLServerAgent的启动账号和密码?&&&&&
- 一个好久没有解决的问题!!!在线等待!!!
- 请问,如果把字符转化成图片,用打印机打印,会有什么影响?会不会不清楚了
- 大虾们!救救我吧!!---一个打印机驱动问题!
dim cn as new adodb.connection
cn.open "dsn=你在ODBC中建立的DSN名称" '这是最简单的写法,具体可能要不同
cn.execute "SQL语句"想要得到select执行结果
dim rs as new adodb.recordset
rs=cn.execute("SQL语句")