動網論壇的asp程式,在一定程度了,成了asp的頂峰之作。高手複製程式碼如下:
<%@LANGUAGE=VBSCRIPT%>
<%
option explicit
dim startime,endtime,conn,strCon,db
startime=timer()
Dim strSQLServerName
Dim strSQLDBUserName
Dim strSQLDBPassword
Dim strSQLDBName
'請填寫資料庫具體參數
'------------------------------------------------- ----------------------------------------------
strSQLServerName = 127.0.0.1 '伺服器名稱或位址
strSQLDBUserName = sa '資料庫帳號
strSQLDBPassword = 123 '資料庫密碼
strSQLDBName = bbsbak '資料庫名稱
'------------------------------------------------- ----------------------------------------------
'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
%>