I am creating an intranet site that allows our users to check status of applications online.
If multiple records are found, I get mutliple asp generated forms. I am trying to add a count function to run prior to running my main select statement. If the count is more that 1 I want to generate a different kind of asp page.
With that said, does anyone have and ideas. Below is a code snippet.
Thanks!
Scott
-----------------------------------------------------------
<%
Dim Start
Set conn = Server.CreateObject("ADODB.Connection"
conn.open "WAM","sa",""
Set Session("WAM_conn" = conn
%>
<%
sql = "SELECT *"
sql = sql & " FROM tblDocumentData" ' From Statement
sql = sql & " WHERE lastname =" & "'" & Request("lname" & "'" ' Where Statement
sql = sql & " AND SSN =" & "'" & Request("ssn" & "'" ' Where Statement
sql = sql & " AND STATUS <> 'Other'"
sql = sql & " ORDER BY CreateDate" ' Order By Statement
sql1 = "SELECT COUNT" ' SELECT STATEMENT
sql1 = sql1 & " FROM tblDocumentData" ' From Statement
sql1 = sql1 & " WHERE lastname =" & "'" & Request("lname" & "'" ' Where Statement
sql1 = sql1 & " AND SSN =" & "'" & Request("ssn" & "'" ' Where Statement
sql1 = sql1 & " AND STATUS <> 'Other'"
'RESPONSE.WRITE SQL1
' This function is used when the submit button is clicked
dim fs,fname,filename,strfilename
strfilename = "scott"
strfilename = strfilename & Request("firstname"
'response.write strfilename
set fs=Server.CreateObject("Scripting.FileSystemObject"
set fname=fs.CreateTextFile("c:\inetpub\crm\temp_files\" & strfilename & ".txt",true)
fname.WriteLine sql
fname.WriteLine sql1
fname.Close
set fname=nothing
set fs=nothing
Set rs = Server.CreateObject("ADODB.Recordset"
rs.Open sql, conn, 3, 3
If rs.eof Then
response.write "No records found."
Else
Set Session("Query1_rs" = rs
%>
<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>
If multiple records are found, I get mutliple asp generated forms. I am trying to add a count function to run prior to running my main select statement. If the count is more that 1 I want to generate a different kind of asp page.
With that said, does anyone have and ideas. Below is a code snippet.
Thanks!
Scott
-----------------------------------------------------------
<%
Dim Start
Set conn = Server.CreateObject("ADODB.Connection"
conn.open "WAM","sa",""
Set Session("WAM_conn" = conn
%>
<%
sql = "SELECT *"
sql = sql & " FROM tblDocumentData" ' From Statement
sql = sql & " WHERE lastname =" & "'" & Request("lname" & "'" ' Where Statement
sql = sql & " AND SSN =" & "'" & Request("ssn" & "'" ' Where Statement
sql = sql & " AND STATUS <> 'Other'"
sql = sql & " ORDER BY CreateDate" ' Order By Statement
sql1 = "SELECT COUNT" ' SELECT STATEMENT
sql1 = sql1 & " FROM tblDocumentData" ' From Statement
sql1 = sql1 & " WHERE lastname =" & "'" & Request("lname" & "'" ' Where Statement
sql1 = sql1 & " AND SSN =" & "'" & Request("ssn" & "'" ' Where Statement
sql1 = sql1 & " AND STATUS <> 'Other'"
'RESPONSE.WRITE SQL1
' This function is used when the submit button is clicked
dim fs,fname,filename,strfilename
strfilename = "scott"
strfilename = strfilename & Request("firstname"
'response.write strfilename
set fs=Server.CreateObject("Scripting.FileSystemObject"
set fname=fs.CreateTextFile("c:\inetpub\crm\temp_files\" & strfilename & ".txt",true)
fname.WriteLine sql
fname.WriteLine sql1
fname.Close
set fname=nothing
set fs=nothing
Set rs = Server.CreateObject("ADODB.Recordset"
rs.Open sql, conn, 3, 3
If rs.eof Then
response.write "No records found."
Else
Set Session("Query1_rs" = rs
%>
<%
On Error Resume Next
rs.MoveFirst
do while Not rs.eof
%>