CJJ专用ASP类库中的某个class(3)


              Case gbl_iDB_MsSQL
                  sConn = "Provider = Sqloledb; User ID = " & oConnStr.DBUser & "; Password = " & Replace(oConnStr.DBPass, Chr(0), "") & ";Initial Catalog = " & oConnStr.DBName & "; Data Source = " & oConnStr.DBServer & ";"
              End Select

              If sConn = "" Then
                  cls_sErrInfo = cls_sErrInfo & "<li>数据库连接对象出错,无法创建Connection对象</li>" & Chr(10)
                  Exit Property
              End If

             '设置Connection连接串值,供ConnStr属性返回
              cls_sConn = sConn

              Set cls_oConn = CreateObject("Adodb.Connection")
              On Error Resume Next
              cls_oConn.Open sConn
               If Err Then
                  Err.Clear
                  Set cls_oConn = Nothing
                  cls_sErrInfo = cls_sErrInfo & "<li>数据库连接出错</li>" & Chr(10)
              End If
              On Error Goto 0
          Case Else
              cls_sErrInfo = cls_sErrInfo & "<li>SetConn:非法的对象参数</li>" & Chr(10)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/3482.html