| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello All,
I'm relatively new to ASP and I was given the task of fixing a website with a few problems that arose after a move to Win 2k3 server from NT4. I've got it mostly figured out but I can't seem to see the problem with this last one. I keep getting the last Else statement (No platform found for this structure id.) no matter what the SID. Any help is greatly appreciated. Carlos <!--METADATA TYPE="typelib" FILE="c:\program files\common files\system\ado\msado15.dll"--> <% Option Explicit %> <html> <body> <center> <% dim oCmd, oParam, oRst, oRst2, intI, strPara dim boolFirstTime, intStructureID, intLeaseValue, intComplexID, strDesc dim lngSessionID, lngUserID set oCmd = server.createObject("ADODB.Command") oCmd.ActiveConnection = "MMSDB" oCmd.CommandText = "QryGetPltStructure" oCmd.CommandType = adCmdStoredProc intStructureID = clng(cstr(request.querystring("SID"))) set oParam = oCmd.CreateParameter("The_Structure", adInteger, adParamInput, , intStructureID) 'name of para, type, direction, size, value oCmd.Parameters.Append oParam set oRst = oCmd.Execute if Not oRst.eof Then boolFirstTime = cstr(request.querystring("FT")) if boolFirstTime <> "No" then 'first time oCmd.CommandText = "QryGetLeasevalue" oParam.value = oRst.fields("complex_ID_num") set oRst2 = oCmd.Execute if not oRst2.eof then intLeaseValue = oRst2.fields("Lease Number Value") strDesc = "Complex ID = " & oRst.fields("complex_ID_num") & _ ", Area: " & oRst2.fields("Area_code") & _ ", Block: " & trim(oRst2.fields("Block_number")) & _ ", Structure: " & oRst2.fields("structure_name") oRst2.movenext do while not oRst2.eof strDesc = strDesc & ", " & oRst2.fields("structure_name") oRst2.movenext loop set oParam = nothing '******************** If left(Request.ServerVariables("REMOTE_ADDR"), 8) = "192.168.1" And cint(right(Request.ServerVariables("REMOTE_ADDR"), 2)) > 2 Then 'do nothing; from tsb internal don't log '********************** else lngSessionID = 341 * (clng(date) mod 1668 + 1) lngUserID = cstr(request.querystring("UID")) 'UID = user_autonumber * 341 * (clng(date) mod 1668 + 1) if lngUserID = "" then lngUserID = 0 if isnumeric(lngUserID) then lngUserID = clng(lngUserID) lngUserID = clng(lngUserID / lngSessionID) else lngUserID = 0 end if oCmd.CommandText = "insert into [tbl - MMS Log] " & _ "(address, host, platform, complexid, structureid, userid) " & _ "values ('" & Request.ServerVariables("REMOTE_ADDR") & "','" & _ Request.ServerVariables("REMOTE_HOST") & _ "', '" & oRst.fields("theName") & "', " & _ oRst.fields("complex_ID_num") & ", " & _ oRst.fields("STRUCTURE_NUMBER") & ", " & _ lngUserID & ")" oCmd.CommandType = 1 oCmd.Prepared = true oCmd.execute end if else intLeaseValue = 0 strDesc = "" end if boolFirstTime = "No" intComplexID = oRst.fields("complex_ID_num") else boolFirstTime = "No" intLeaseValue = clng(cstr(request.querystring("LV"))) strDesc = cstr(request.querystring("Desc")) intComplexID = clng(cstr(request.querystring("CID"))) intLeaseValue = clng(cstr(request.querystring("LV"))) end if strPara = "FT=" & boolFirstTime & "&SID=" & intStructureID & _ "&CID=" & intComplexID & "&LV=" & intLeaseValue & "&Desc=" & Server.URLEncode(strDesc) ' strPara = Server.URLEncode(strPara) response.write "<font size=-1>Structure Information</font> " response.write "<a href='get_Complex.asp?" & strPara & "'>" & _ "<font size=-1>Complex Information</font>" & _ "</a> " response.write "<a href='get_Pipeline.asp?" & strPara & "'>" & _ "<font size=-1>Pipeline Information</font>" & _ "</a> " response.write "<a href='get_Well.asp?" & strPara & "'>" & _ "<font size=-1>Well Information</font>" & _ "</a>" response.write "<br>" response.write "<table border='1'>" response.write " <tr><td colspan='6'><B>Structure Information</b></td></tr>" for intI = 2 To oRst.Fields.Count - 5 response.write oRst.Fields(intI) next response.write "</table>" else response.write "<br><br><b>No platform found for this structure id.</b><br>" End If %> <br>Print this Frame. No claim to original government works. <!-- #include file="./footer.inc" --> </center> </body> </html> |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Help with Code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|