I posted this question before, but I'm still having a problem with it. As you can see from the code snippet, Form.Level is numeric, and is defined in my Access database as a number(long integer). It was suggested that to post a numeric value, I do not need single quotes around the variable name. With or without, I get the same error as shown below.
And this is the result:
Form.Level = 5
Form.Level is numeric.
--------------------------------------------------------------------------------
Error Occurred While Processing Request
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (15:1) to (15:52) in the template file C:\INETPUB\
Date/Time: 01/31/01 11:02:24
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
Remote Address: 127.0.0.1
HTTP Referer:
I'm really going crazy over this one!X-)
Code:
Form.Level = <cfoutput>#Form.Level#</cfoutput><br>
<cfif IsNumeric(#Form.Level#)>
<cfoutput>Form.Level is numeric.</cfoutput>
<cfelse>
<cfoutput>Form.Level IS NOT numeric.</cfoutput>
</cfif>
<CFQUERY NAME="RecordResults" DATASOURCE="Question">
INSERT INTO ATable
(
Level
)
values
(
#form.Level#
)
</cfquery>
And this is the result:
Form.Level = 5
Form.Level is numeric.
--------------------------------------------------------------------------------
Error Occurred While Processing Request
Error Diagnostic Information
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (15:1) to (15:52) in the template file C:\INETPUB\
Date/Time: 01/31/01 11:02:24
Browser: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT)
Remote Address: 127.0.0.1
HTTP Referer:
I'm really going crazy over this one!X-)