The ASP program of Dongwang Forum has, to a certain extent, become the pinnacle of ASP. The master copy code is as follows:
<%@LANGUAGE=VBSCRIPT%>
<%
option explicit
dim startime,endtime,conn,strCon,db
startime=timer()
Dim strSQLServerName
Dim strSQLDBUserName
Dim strSQLDBPassword
Dim strSQLDBName
'Please fill in the specific parameters of the database
'------------------------------------------------ --------------------------------------------------
strSQLServerName = 127.0.0.1 'Server name or address
strSQLDBUserName = sa 'Database account
strSQLDBPassword = 123 'Database password
strSQLDBName = bbsbak 'Database name
'------------------------------------------------ --------------------------------------------------
'SQL Server OLE Driver
Set conn = Server.CreateObject(ADODB.Connection)
strCon = Provider=SQLOLEDB;Server= & strSQLServerName & ;User ID= & strSQLDBUserName & ;Password= & strSQLDBPassword & ;Database= & strSQLDBName & ;
conn.Open strCon
function CloseDatabase
Conn.close
Set conn = Nothing
End Function
%>