|
如何自动发布MS SQL SERVER数据库?
来源:不详 作者 佚名 点击数: 录入时间:07-12-19 21:51:19
'程序编写: 陈林茂
‘编写日期:2003-01-01
当您的MIS系统开发好以后,您如何尽快的分发您的数据库呢?
下面我将提供VB代码的具体实现:
Option Explicit
'define the sql connect Dim oSQLServer As SQLDMO.SQLServer Dim oCurrentDB As SQLDMO.Database Dim oCurrentTable As SQLDMO.Table Dim oTestIdx As SQLDMO.Index
'sqlDmo is Connected Yes or No Public sName As String Private IsConnected As Boolean
'connect to local database server Public Function ConnectDmo() As Boolean On Error GoTo HandleError 'If we're connected, then disconnect and clear lists. If IsConnected = True Then oSQLServer.DisConnect IsConnected = False End If 'Begin connect to sqlserver or msde 'Attempt a connection, then fill the properties stuff. oSQLServer.ApplicationName = "SQL-DMO Index Test" oSQLServer.LoginSecure = True 'connect oSQLServer.Connect "(local)", "sa", "" IsConnected = True ConnectDmo = True HandleError: 'connect[1] [2] [3] 下一页
|