動網フォーラムのaspデータベース接続コード
1239 ワード
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
%>