Hi again,
On my form the user is be able to select a category from a drop down menu....if it is not there the user can select the option "Other..", then enter a new category in the text box...
The new category is added to the db and everything works hunky dory, but if the user selects a category from the drop down menu... the following error appears...
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
The error occurred in E:\CFusionMX\ line 63
61 : <cfoutput query="qGetSubCatID">#Sub_Cat_ID#</cfoutput>
62 : <cfelse>#FORM.sub_category#
63 : </cfif>
64 : )
65 : </cfquery>
SQL INSERT INTO Business ( Market_ID, Zone_ID, Area_ID, Category_ID, Sub_Cat_ID ) VALUES ( '2', '2', '5', '2', )
DATASOURCE Y_Business
VENDORERRORCODE -3502
SQLSTATE 42000
Here my code and i'm running access2000 if it helps...
<cfquery datasource="Y_Business" name="qInsertCategory">
INSERT INTO Business
(
Market_ID,
Zone_ID,
Area_ID,
Category_ID,
Sub_Cat_ID
)
VALUES
(
'#FORM.market#',
'#FORM.zone#',
'#FORM.area#',
'#FORM.category#',
<cfif isDefined("FORM.other_sub_cat")>
<cfoutput query="qGetSubCatID">#Sub_Cat_ID#</cfoutput>
<cfelse>#FORM.sub_category#
</cfif>
)
</cfquery>
On my form the user is be able to select a category from a drop down menu....if it is not there the user can select the option "Other..", then enter a new category in the text box...
The new category is added to the db and everything works hunky dory, but if the user selects a category from the drop down menu... the following error appears...
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
The error occurred in E:\CFusionMX\ line 63
61 : <cfoutput query="qGetSubCatID">#Sub_Cat_ID#</cfoutput>
62 : <cfelse>#FORM.sub_category#
63 : </cfif>
64 : )
65 : </cfquery>
SQL INSERT INTO Business ( Market_ID, Zone_ID, Area_ID, Category_ID, Sub_Cat_ID ) VALUES ( '2', '2', '5', '2', )
DATASOURCE Y_Business
VENDORERRORCODE -3502
SQLSTATE 42000
Here my code and i'm running access2000 if it helps...
<cfquery datasource="Y_Business" name="qInsertCategory">
INSERT INTO Business
(
Market_ID,
Zone_ID,
Area_ID,
Category_ID,
Sub_Cat_ID
)
VALUES
(
'#FORM.market#',
'#FORM.zone#',
'#FORM.area#',
'#FORM.category#',
<cfif isDefined("FORM.other_sub_cat")>
<cfoutput query="qGetSubCatID">#Sub_Cat_ID#</cfoutput>
<cfelse>#FORM.sub_category#
</cfif>
)
</cfquery>