Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: dynamic variable name problem


Message #1 by "Michael Shulman" <mikeinapo@h...> on Fri, 23 Nov 2001 15:21:54 -0500
I wrote some code that dynamically names a checkbox to the ID field, and

then

when the user clicks Submit, the amount specified in the database field left

will be decreased by 1. I dont know how to specify this in the statement.

The nameing that I use names the checkbox the ID NUMBER, from the field ID

<input type = "checkbox" name=<%=rst.fields("id").value %>



The SQL statement I try to use is



MYSQL = "UPDATE inventor SET left=left-1 WHERE (ID= " &

rst.fields("id").value

 & ")"



The Error that I get is

Microsoft JET Database Engine (0x80040E14)

Syntax error in UPDATE statement.





Thank you for any help

Michael Shulman



Message #2 by "Zee Computer Consulting" <zee@t...> on Sat, 24 Nov 2001 15:56:28 -0800
I would try changing your field name from "left" to something else. "Left"

is a string function name as in:



    ThisChar = left( ThisString, 1 )



(Also: Is the ID number a numeric database field? )





Does this help?



-- Z









----- Original Message -----

From: "Michael Shulman" <mikeinapo@h...>

To: "Access ASP" <access_asp@p...>

Sent: Friday, November 23, 2001 12:21 PM

Subject: [access_asp] dynamic variable name problem





> I wrote some code that dynamically names a checkbox to the ID field, and

> then

> when the user clicks Submit, the amount specified in the database field

left

> will be decreased by 1. I dont know how to specify this in the statement.

> The nameing that I use names the checkbox the ID NUMBER, from the field ID

> <input type = "checkbox" name=<%=rst.fields("id").value %>

>

> The SQL statement I try to use is

>

> MYSQL = "UPDATE inventor SET left=left-1 WHERE (ID= " &

> rst.fields("id").value

>  & ")"

>

> The Error that I get is

> Microsoft JET Database Engine (0x80040E14)

> Syntax error in UPDATE statement.

>

>

> Thank you for any help

> Michael Shulman

>

>




>




  Return to Index