What i have here is a simple form that i would like to enter sql commands on, thus the form being submitted to itself and performing the query. However, When i do a select this code works but if i try to do an update from this page i get an odbc 37000 error.
thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<cfif IsDefined("PAGEACTION"
>
<cfquery name="ffdb" datasource="football">
#FORM.Q#
</cfquery>
<cfoutput>
<cfdump var="#ffdb#"><br>
</cfoutput>
</cfif>
<cfform action="#cgi.script_name#" method="Post" name="QForm">
<input type="HIDDEN" name="PageAction">
Query<br>
<textarea cols="60" rows="8" name="Q" wrap="virtual"></textarea><br>
<input type="Submit" value="Submit">
</cfform>
</body>
</html>
the database i am using is MS access 97
I also tried sql server 2000 and got the same error
Cf Server version is 5.0
here is the update query
------------
update users set real_name='Jim' where user_id=1
-----------
table name is users
Here is the error message
------------
Error Occurred While Processing Request
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '''Jim'''.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (11:2) to (11:44).
update users set real_name='Jim' where user_id=1
thanks
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<cfif IsDefined("PAGEACTION"
<cfquery name="ffdb" datasource="football">
#FORM.Q#
</cfquery>
<cfoutput>
<cfdump var="#ffdb#"><br>
</cfoutput>
</cfif>
<cfform action="#cgi.script_name#" method="Post" name="QForm">
<input type="HIDDEN" name="PageAction">
Query<br>
<textarea cols="60" rows="8" name="Q" wrap="virtual"></textarea><br>
<input type="Submit" value="Submit">
</cfform>
</body>
</html>
the database i am using is MS access 97
I also tried sql server 2000 and got the same error
Cf Server version is 5.0
here is the update query
------------
update users set real_name='Jim' where user_id=1
-----------
table name is users
Here is the error message
------------
Error Occurred While Processing Request
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression '''Jim'''.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (11:2) to (11:44).
update users set real_name='Jim' where user_id=1