ASP database connection and shutdown program

Source: Internet
Author: User

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 "<div style=" "Font-family:arial,verdana; font-size:12px; "" > "& cfg.sysversion &" Execution error ("& Now () &") <a href= "JavaScript Tutorial: History.back ();" " > Return </a> <a href= "" Javascript:location.reload (); "" > Retry </a><br/><br/> Error Source: <br/><span style= "" Color: #FF0000 "" > Database connection Error </span> <br/> Error Description: <br/><span style= "" Color: #FF0000 "" > "& errorinfo &" </span> "
Response.Write "</div>"
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

' function: Creating a Database Recordset object
' Parameters: Link string
Public Function RecordSet (obj)
Set obj = Server.CreateObject (cfg.nrecordsetobject)
End Function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.