Forum Moderators: phranque
sDataId = request.Form("DataList")
sRType = request.Form("ReportType")
if sRType = 111 then
response.Redirect("/pmf/ReportType1.asp")
else if sRType = 2 then
response.Redirect("/pmf/ReportType2.asp")
else if sRType = 3 then
response.Redirect("/pmf/ReportType3.asp")
else if sRType = 41 then
response.Redirect("/pmf/ReportType41.asp")
else if sRType = 42 then
response.Redirect("/pmf/ReportType42.asp")
else if sRType = 5 then
response.Redirect("/pmf/ReportType5.asp")
else if sRType = 61 then
response.Redirect("/pmf/ReportType61.asp")
else if sRType = 62 then
response.Redirect("/pmf/ReportType62.asp")
else if sRType = 7 then
response.Redirect("/pmf/ReportType7.asp")
else
set conn=Server.CreateObject("ADODB.Connection")
conn.open "Driver={SQL Server};" & _
"Server=(local);" & _
"Database=UEMAPmf;" & _
"Uid=sa;" & _
"Password=#*$!xx"
sqlstmt = "Select reporttype from PmfIndicators p,IndicatorData d where " & _
" p.indicatorno = d.datanumber and p.indicatorno = '" & sRType & "'"
set rsSelect= server.CreateObject("ADODB.recordset")
rsSelect.open sqlstmt, conn
sType = rsSelect.fields("reporttype")
rsSelect.close
end if
set rsSelect=nothing
conn.close
set conn=nothing
set sqlstmt=nothing
%>
rsSelect.open sqlstmt, conn
sType = rsSelect.fields("reporttype")
rsSelect.close
set sqlstmt=nothing
end if
set rsSelect=nothing
conn.close
set conn=nothing
Try moving that line in red to that position and see if it helps.
Onya
Woz
**************************************
sType = rsSelect.fields("reporttype")
rsSelect.close
set sqlstmt=nothing
set rsSelect=nothing
conn.close
set conn=nothing
end if
*****************************************
How can i sove it please?
Thanks.
if sRType = 111 then
response.Redirect("/pmf/ReportType1.asp")
else if sRType = 2 then ................. If one of these conditions is met the visitor is redirected and the conditions can be closed.
End if If none of these conditions were met then move on to the next action :
set conn=Server.CreateObject("ADODB.Connection") ............. If you still have a problem than change 'else if' to 'elseif' that's how I've always seen it written.