CJJ专用ASP类库中的某个class(2)
On Error Resume Next
cls_oConn.Open a_sConn
If Err Then
Err.Clear
Set cls_oConn = Nothing
On error goto 0
cls_sErrInfo = cls_sErrInfo & "<li>数据库连接出错</li>" & Chr(10)
End If
On Error Goto 0
End Property
'*****************************************
' 类型: 属性
' 目的: 根据获取的Connection对象,创建数据库连接
' 输入: a_oConn:数据类型字符串
' 返回: 无
'*****************************************
Public Property Set SetConn(a_oConn)
Dim sObjType,sConn
Dim oConnStr
sObjType = LCase(TypeName(a_oConn))
Select Case sObjType
Case "connection"
'设置Connection对象
Set cls_oConn = a_oConn
Case "tconnstring"
sConn = ""
Set oConnStr = a_oConn
Select Case (oConnStr.DBType)
Case gbl_iDB_Access
sConn = "Provider = micorsoft.jet.oledb.4.0; User ID = " & oConnStr.DBUser & "; Password = " & Replace(oConnStr.DBPass, Chr(0), "") & ";Initial Catalog = " & oConnStr.DBName & "; Data Source = " & SqlLocalName & ";"
内容版权声明:除非注明,否则皆为本站原创文章。