Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old September 27th, 2004, 03:27 PM
Carlitosway Carlitosway is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 Carlitosway User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Help with Code

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> &nbsp; &nbsp; &nbsp;"

response.write "<a href='get_Complex.asp?" & strPara & "'>" & _
"<font size=-1>Complex Information</font>" & _
"</a> &nbsp; &nbsp; &nbsp;"

response.write "<a href='get_Pipeline.asp?" & strPara & "'>" & _
"<font size=-1>Pipeline Information</font>" & _
"</a> &nbsp; &nbsp; &nbsp;"

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>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Help with Code


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway