一聚教程网:一个值得你收藏的教程网站

热门教程

asp 数据库连接与关闭程序

时间:2022-06-30 10:09:34 编辑:袖梨 来源:一聚教程网

Public Function DbOpen()
  If IsObject(Conn) Then Exit Function
  Set Conn = Server.CreateObject(Cfg.nConnectionObject)
  If Conn.State = 1 Then Exit Function
  On Error Resume Next
  Conn.Open ConnStr
  If Err.Number Then
   ErrorInfo = Err.Description
   Err.Clear
   Set Conn = Nothing
   Response.Write "

"& Cfg.sysVersion &"执行错误("& Now() &") javascript教程:history.back();"">返回 重试

错误源:
数据库连接错误
错误描述:
" & ErrorInfo & ""
   Response.Write "
"
   Response.End()
  End If
    End Function
 
    Public Function DbClose()
  If Not IsObject(Conn) Then Exit Function
  If Conn.State = 0 Then Exit Function
  Conn.Close:Set Conn = Nothing
 End Function

    '函数:创建数据库RecordSet对象
    '参数:链接串
    Public Function RecordSet(obj)
        Set obj = Server.CreateObject(Cfg.nRecordSetObject)
    End Function

热门栏目