Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with if statement or recordset

Status
Not open for further replies.

malola123

Technical User
Feb 16, 2007
17
CA
Hi,

Im trying fixing some code that has been created to produce a web form. At one point during this code, I have included a sql query to create a recordset, and created an if statement to control whether the form can be submitted or not. After making the necessary changes, I checked the webpage if the update worked. However the webpage produces an error that is of no relevance to the problem. Could someone take a look and tell me what im doin wrong?

error location: /IS/Sections/Requests/create_Request.asp, line 357, column 21

(error has not been mentioned)

Here is the block of code that im having trouble with:

If (requestID <> "") || (copyId <> "") Then


stmt = "SELECT T_IS_Request.id AS RequestID, T_IS_Request.revision, T_IS_Request.GroupingID, T_IS_Request.ProjectName, T_IS_Request.ProjectTier, "&_
"T_IS_Request.ProjectPhase, T_IS_Request.ProjectManager, T_IS_Request.ProjectManagerEmail, T_IS_Request.BusinessSignoff, "&_
"T_IS_Request.Initiator, T_IS_Request.InitiatorEmail, T_IS_Request.FYINotice, T_IS_Request.INNATE, T_IS_Request.ITNumber, T_IS_Request.CCC, "&_
"T_IS_Request.BusinessUnit, T_IS_Request.TSDevGroup, T_IS_Request.UrgentFix, T_IS_Request.TypeOfChanges, "&_
"T_IS_Request.DistributedApplications, T_IS_Request.HostApplications, T_IS_Request.ProposedHandover, T_IS_Request.Proposedimplementation, "&_
"T_IS_Request.GreaterThenCutOff, T_IS_Request.PCOENeeded, T_IS_Request.Description, T_IS_Request.GroupsInvolved, T_IS_Request.CreationDate, "&_
"T_IS_Request.SubmissionDate, T_IS_Request_Grouping.Password AS Password, T_IS_Request_Grouping.Submitted, "&_
"T_Initial_Performance_Questionnaire.TypeOfBusAppsUsed, T_Initial_Performance_Questionnaire.RetailBranches, "&_
"T_Initial_Performance_Questionnaire.AppEnvironment, T_Initial_Performance_Questionnaire.DataLocation, "&_
"T_Initial_Performance_Questionnaire.MaxConcurrentUsers, T_Initial_Performance_Questionnaire.AppHaveSLA, "&_
"T_Initial_Performance_Questionnaire.AppShownToExternalCustomers, T_Initial_Performance_Questionnaire.NeedToMeetPerfReq, "&_
"T_Initial_Performance_Questionnaire.InfraChanges, T_Initial_Performance_Questionnaire.NewArchComponents "&_
"FROM T_IS_Request INNER JOIN "&_
"T_IS_Request_Grouping ON T_IS_Request.GroupingID = T_IS_Request_Grouping.id INNER JOIN "&_
"T_Initial_Performance_Questionnaire ON T_IS_Request_Grouping.PCOEInitial = T_Initial_Performance_Questionnaire.id "&_
"WHERE (T_IS_Request.id = "& requestID & copyId &")"



Set oRs = oConn.Execute(stmt)



''Check if nothing was returned, if so the form was already submitted
If (T_IS_Request_Grouping.Submitted <> 1) || (requestID == "") Then
Response.Write "<td style=""width:100%;text-align:center; padding-left:30px; padding-right:30px; padding-top:10px"">"
Response.Write "<script language='javascript' type='text/javascript'>window.onbeforeunload = null;</script>"
Response.Write "<form method=GET name=""form1"" action=""create_request.asp"" >"
Response.Write "<B>Sorry, you are not able to modify this request. It has already been submitted</B><BR>"
Response.Write "<input type=hidden name='BTNSave' value=""Submit"">"
Response.Write "<input name='BTNSubmit' type=hidden>"
Response.Write "<input type=hidden name=""id"" value="""& requestID &""">"
Response.Write "</form>"
Response.Write "</table>"
Response.End
End If

 
I guess the error is here:
If ([!]T_IS_Request_Grouping.Submitted[/!] <> 1) || (requestID == "") Then

You should play with the Fields collection of your oRs object.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top