Search code examples
sqlms-accesscoldfusioncoldfusion-9

Can not reproduce this [ODBC Microsoft Access Driver] Syntax error


This one has me stumped. Three of my clients have received this error, but I can not reproduce it on my end!

[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

In general, what would cause a discrepancy in who receives this kind of DB error, what kind of issues would keep me from being able to replicate it on my end?

Here's the bit of code that I believe is causing the error:

<cfquery 
name="rsAddSKUs" 
datasource="#request.dsn#" 
username="#request.dsnUsername#" 
password="#request.dsnPassword#">
    INSERT INTO 
    tbl_orderskus 
        ( orderSKU_OrderID
        , orderSKU_SKU
        , orderSKU_Quantity
        , orderSKU_UnitPrice
        , orderSKU_SKUTotal
        , orderSKU_Picked
        , orderSKU_TaxRate
        , orderSKU_DiscountID
        , orderSKU_DiscountAmount)
    VALUES 
        ('#var.ThisOrderID#'
        , #rsGetCart.SKU_ID#
        , #rsGetCart.Qty#
        , #rsGetCart.SKU_Price#
        , #SKUTotal#
        , 0
        , #var.thisProductTax#
        , #var.thisDiscountID#
        , #var.thisdiscountAmount#)
</cfquery>

Thanks, Biscotti


Solution

  • My first inclination is one of the numeric fields are blank and the insert statement is trying to insert a ,, instead of a value