|
-
June 10th, 2013, 11:49 AM
#10
Re: Error code help needed
 Originally Posted by DataMiser
Your code checks to see if typename is an empty string if it is then it displays a message if it is not then it executes a select statement which uses iType as a where clause but your script does not test the value of iType so it would process it no matter what the value or lack of a value and looks to be the cause of the error. See the lines in Red
Code:
If Request("TypeName")="" Then
If Flag Then
Response.Write "<p class='subtitle'>You must enter a cateogry name.</p>"
Else
' If Flag isn't true, show the edit form:
Dim CategoryRS
Set CategoryRS = Server.CreateObject("ADODB.Recordset")
CategoryRS.Open "SELECT * FROM Type WHERE TypeId =" & Request("iType"), Connect, 2, 3
End If
I am assuming that this is a server side ASP script and that iType is the name of an object that is on a form that been posted?
Hi and once again many thanks for your reply. You are bang on with the understanding that this is a server side .asp script. It uses an admin panel to update, add or edit given categories. I have checked through things and noted that even when you enter a "" value the category is added to the database with the default colour of black. None of the other fields contain information. iType is a value held in one of the fields labelled EventType in the .db which contains a value of "0" when entered without a category name. I though that if the category had not been named then the code should have returned an error message and not updated the .db with a prompt to correct it. If I try to access this .db through my browser then I am able to see that the error points to a value with iType. What I don't understand is how to check for an invalid entry when the code to do it is there. Do I need to modify the code or the .db? As mentioned... newbie struggling with basics here :-( thanks so much for your help so far, very commendable and forums seem to be the place to get expert help, reassuring to know there is somebody out there that takes an interest in newcomers. I'm going to get stuck into the code again and try to understand what it is doing, where and when. Maybe I can insert some form of debugging script in to pinpoint what I need to do and where ???
regards
David A
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|