%@ Language=VBScript %>
<% Option Explicit %>
<%
'Open connection string using App variable
Dim sConn, con, ProjID, PageNum
sConn=Application("TMAConnectString")
Set con=Server.CreateObject("ADODB.Connection")
con.ConnectionString=sConn
con.Open
ProjID=Session("ProjID")
%>
The Modular Advantage: Client Area
Question/Answer Processing
<%
'Create a recordset object instance and retrieve the information from the table
Dim rs, SQL, SubmitType
'Open the main recordset
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockPessimistic
SubmitType=Request("SubmitType")
If SubmitType="Answer" then
SQL="SELECT * FROM Questions " _
& "WHERE ID=" & Request("ID")
rs.Open SQL, con
rs("AnswerDate")=Date()
rs("Answer")=Request("Answer")
rs.Update
Else
SQL="SELECT * FROM Questions "
rs.Open SQL, con
rs.AddNew
rs("QuestionDate")=Date()
rs("Question")=Request("Question")
rs("Type")=Request("Type")
rs("ProjectID")=ProjID
rs.Update
End If
%>