Hi,
I am using Coldfusion 7 on MS Vista w/Dreamweaver 8 using MSAccess 2007 saving my database as MSACCESS 2003.
When I use the insert record wizzard in Dreamweaver, I get the following error message on half of my tables in my database.
I suspect my syntax is wrong, but I cant figure out how to edit it. I have created test tables (like the one I am describing here) with only a few fields and no relationships. I have read lots of strings on this topic, so that is why I simply created test tables with all text fields except the primary key and a potential relation field.
I think one of my troubleshooting problems is that I dont know how to enter my sql statement into the Access query builder regarding the value of my (param) statements. But I can enter data fine from within Access, either directly into the tables or from a custom query.
What should I try next?
CODE
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "form1">
<cfquery datasource="#Request.DSN#">
INSERT INTO customers (usertypeid, username, password)
VALUES (
<cfif IsDefined("FORM.usertypeid") AND #FORM.usertypeid# NEQ "">
<cfqueryparam value="#FORM.usertypeid#" cfsqltype="cf_sql_numeric">
<cfelse>
NULL
</cfif>
,
<cfif IsDefined("FORM.username") AND #FORM.username# NEQ "">
<cfqueryparam value="#FORM.username#" cfsqltype="cf_sql_clob" maxlength="255">
<cfelse>
''
</cfif>
,
<cfif IsDefined("FORM.password") AND #FORM.password# NEQ "">
<cfqueryparam value="#FORM.password#" cfsqltype="cf_sql_clob" maxlength="255">
<cfelse>
''
</cfif>
)
</cfquery>
<cflocation url="/admin/adminindex.cfm">
</cfif>
==================================================
Error Executing Database Query.
Syntax error in INSERT INTO statement.
The error occurred in C:\CFusionMX7\wwwroot\admin\users\adduser.cfm: line 22
20 : <cfelse>
21 : ''
22 : </cfif>
23 : )
24 : </cfquery>
--------------------------------------------------------------------------------
SQL INSERT INTO customers (usertypeid, username, password) VALUES ( (param 1) , (param 2) , (param 3) )
DATASOURCE DaytonFSBO
VENDORERRORCODE 3092
SQLSTATE
Please try the following:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; InfoPath.2)
Remote Address 127.0.0.1
Referrer
http://localhost:8500/admin/users/adduser.cfm Date/Time 28-Mar-07 03:32 PM
Stack Trace (click to expand)
==========================================================