首页 > 编程 > ASP > 正文

在线管理数据库 类

2024-05-04 11:03:05
字体:
来源:转载
供稿:网友
<%
Class RLManDBCls
    Private sDBPath, RLConn, sDBType, sServerName, sUserName, sPassword
    Public Count    
    Private Sub Class_Initialize()
        sDBType = ""
    End Sub    
    Private Sub Class_Terminate()
        If IsObject(RlConn) Then
            RlConn.Close
            Set RlConn = Nothing
        End if
    End Sub    
    Public Property Let DBType(ByVal strVar)
        sDBType = strVar
    End Property
    Public Property Let ServerName(ByVal strVar)
        sServerName = strVar
    End Property
    Public Property Let UserName(ByVal strVar)
        sUserName = strVar
    End Property
    Public Property Let Password(ByVal strVar)
        sPassword = strVar
    End Property
    '设置数据库路径
    Public Property Let DBPath(ByVal strVar)
        sDBPath = strVar
        Select Case sDBType
        Case "SQL"
            StrServer = sServerName '数据库服务器名
            StrUid = sUserName '您的登录帐号
            StrSaPwd = sPassword '您的登录密码
            StrDbName = sDBPath '您的数据库名称            
            sDBPath = "driver={SQL server};server=" & StrServer & ";uid=" & StrUid & ";pwd=" & StrSaPwd & ";database=" & StrDbName
        Case "ACCESS",""
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表