I try to do update to Database through ASP.
There are two textbox in the form, "txtstyID" and "txtstyName".
The code is like that:
<%
... ...
strSQL="UPDATE qryStylesAll SET Style_Name = '" & request.form("txtstyName")
& "' WHERE Style_ID =" & request.form("txtstyID")
... ...
%>
e.g. txtstyID =24,
It didn't work,
Then,
When I response.write the strSQL, It showed:
"UPDATE qryStylesAll SET Style_Name = "Hello" WHERE Style_ID =24, 24"
(BUT when I change the strSQL to, "... WHERE Style_ID=24 ", it works)
What's the problem?
What's wrong with the field of txtstyID ?
davidp - 21 Dec 2005 16:31 GMT
I'm not the greatest at ASP
Is request.form("txtstyID") returning '24' or '24,24'?
From the post it appears to be 24,24. This will error out.
Validate the value that is being passed from the form.
> I try to do update to Database through ASP.
> There are two textbox in the form, "txtstyID" and "txtstyName".
[quoted text clipped - 18 lines]
> What's the problem?
> What's wrong with the field of txtstyID ?