%
cid = request("cid")
cid = CInt(cid)
set conn = GetSQLServerConnection("DATA001","y2k","y2k415","youth")
if cid = 0 then
response.redirect "forum.asp"
else
SQL = "Select * from Counseling_forum where cid = " & cid & " and main = 1"
set rs = GetSQLServerRecordset(conn, SQL)
end if
%>
Youth-2000.com [滅罪會 On-line Counseling]
<%
Function GetSQLServerRecordset( conn, source )
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open source, conn, 3, 2
Set GetSQLServerRecordset = rs
End Function
Function GetSQLServerConnection( Computer, UserID, Password, Db )
Dim Params, conn
Set GetSQLServerConnection = Nothing
Params = "Provider=SQLOLEDB.1"
Params = Params & ";Data Source=" & Computer
Params = Params & ";User ID=" & UserID
Params = Params & ";Password=" & Password
Params = Params & ";Initial Catalog=" & Db
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open Params
Set GetSQLServerConnection = conn
End Function
%>