The code copy is as follows:
'************************************************
'The following are database related functions
'************************************************
'===========================================================
'Initialize the database connection object
'Usage principle: call the latest, release the earliest
'===========================================================
SubDBConnBegin()
'If the database object is already open, do not open it again
IfIsObject(oConn)=TrueThenExitSub
'You can open the record set object directly without opening the database connection object, but if you need to open multiple record set objects, the efficiency is very inefficient.
'If you don't create a database connection object, ADO will automatically create a new database connection object when each record set is opened, even if you are using the same SQL statement.
SetoConn=Server.CreateObject("ADODB.Connection")
OnErrorResumeNext
oConn.Open"Provider=Microsoft.Jet.OLEDB.4.0;DataSource="&Server.MapPath("db/lbedit.mdb")
IfErr.Number>0Then
'Show error message and send an email to notify the administrator
'CallDBConnError(Err)
'Exit the running script completely
Response.End
EndIf
'Create a record set
SetoRs=Server.CreateObject("ADODB.Recordset")
EndSub