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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request form object and inStr error

Status
Not open for further replies.

mwolf00

Programmer
Nov 5, 2001
4,177
US
I'm sure that I'm being neearsighted, but I am getting the following errror:

Type mismatch: '[string: "22c1"]'


When I run this code...

for each item in request.form
select case true
case inStr(item,"finalError",1) > 0 'first error occurance'
sql = "UPDATE daAnswers set finalError = " & request.form(item)
case inStr(item,"error",1) > 0
sql = "UPDATE daAnswers set error = " & request.form(item)
case inStr(item,"comments",1) > 0
sql = "UPDATE daAnswers set comments = '" & left(replace(trim(request.form(item)),"'","''"),255) & "'"
case else
sql = "UPDATE daAnswers set " & right(item,2) & " = '" & replace(trim(request.form(item)),"'","''") & "'"
end select
//response.write &quot;<br>&quot; & item & &quot; - &quot; & request.form(item)
response.write &quot;<br>&quot; & sql
next


It seems to be telling me that &quot;item&quot; is not a string - but it isn't an object either - what is it?

I apologize for my fuzzy brain - it's early Monday AM....


Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
DOH - said it was early...

&quot;You must specify a START argument if you are specifying a compareMode arguement&quot;


for each item in request.form
select case true
case inStr(1,item,&quot;finalError&quot;,1) > 0 '<
sql = &quot;UPDATE daAnswers set finalError = &quot; & request.form(item)
case inStr(1,item,&quot;error&quot;,1) > 0 '<
sql = &quot;UPDATE daAnswers set error = &quot; & request.form(item)
case inStr(1,item,&quot;comments&quot;,1) > 0 '<
sql = &quot;UPDATE daAnswers set comments = '&quot; & left(replace(trim(request.form(item)),&quot;'&quot;,&quot;''&quot;),255) & &quot;'&quot;
case else
sql = &quot;UPDATE daAnswers set &quot; & right(item,2) & &quot; = '&quot; & replace(trim(request.form(item)),&quot;'&quot;,&quot;''&quot;) & &quot;'&quot;
end select
//response.write &quot;<br>&quot; & item & &quot; - &quot; & request.form(item)
response.write &quot;<br>&quot; & sql
next

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I would have gotten to it, eventually...I couldn't see the problem either...more coffee

:)

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
Hey Tarwyn -

Still using your &quot;SELECT CASE TRUE&quot; construction - very handy....

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
I noticed :)
Though even that took me an extra second to figure out :p
Coffee just isn't doing it's job today...must be the lack of cute drive throughgirl that a certain other forum member gets with his coffee in the morning...not only does he take my spot...*sigh*

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top