Error after upgrade "Error Executing Database Query. "

Ask a Question related to Coldfusion Server Administration, Design and Development.

  1. #1

    Default Error after upgrade "Error Executing Database Query. "

    I have set up a new server with CF MX 6.1. I have moved code from a CF 5
    server. Now I am getting a lot of errors like this one. They all vary
    somewhat but seem to be related to two things. The problems seem to occur with
    CFINSERT to an access database. I have been trying to fix this for some time
    now and would appreciate any input. I have installed both the cf 'service
    pack' and a hot fix that I thought was related directly to this.


    Error Occurred While Processing Request
    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
    C:\Inetpub\vhosts\mysite.com\httpdocs\Ezedit\act_i nsert.cfm: line 14
    Called from C:\Inetpub\vhosts\mysite.com\httpdocs\Ezedit\index .cfm: line 53
    Called from C:\Inetpub\vhosts\mysite.com\httpdocs\Ezedit\act_i nsert.cfm: line
    14
    Called from C:\Inetpub\vhosts\mysite.com\httpdocs\Ezedit\index .cfm: line 53

    12 : <CFELSEIF #ProductScan.Recordcount# IS 0>
    13 :
    14 : <CFINSERT DATASOURCE="mysite" TABLENAME="#Table#" username="admin"
    password="">
    15 :
    16 : <CFQUERY datasource="mysite">




    --------------------------------------------------------------------------------

    SQL insert into Products
    (WIDTH,HOTBUY,RETAIL1,REPEAT,HEIGHT,PRODUCTTITLE,J OIN,AJOIN,MATERIAL,OBJECTGROUP
    _ID,BOOKNAME,OBJECTGROUP_ID2,VJOIN,PRODUCTDESCRIPT ION1,LENGTH,SAMPLE,MANUFACTURE
    RPARTNO) values ( (param 1) , (param 2) , (param 3) , (param 4) , (param 5) ,
    (param 6) , (param 7) , (param 8) , (param 9) , (param 10) , (param 11) ,
    (param 12) , (param 13) , (param 14) , (param 15) , (param 16) , (param 17) )
    DATASOURCE mysite
    VENDORERRORCODE -3502
    SQLSTATE 42000

    Please try the following:



    <CFIF IsDefined ("Table") AND Table EQ "Products">

    <CFQUERY datasource="mysite" name="ProductScan">
    SELECT Producttitle
    FROM Products
    WHERE ProductTitle = '#ProductTitle#'
    </CFQUERY>

    <CFIF #ProductScan.Recordcount# IS NOT 0>
    <CFLOCATION url="index.cfm?Confirm=Exists&ProductTitle=#Produc tTitle#">

    <CFELSEIF #ProductScan.Recordcount# IS 0>

    <CFINSERT DATASOURCE="mysite" TABLENAME="#Table#">

    <CFQUERY datasource="mysite">
    INSERT INTO Products(ProductTitle,retail1,sample)
    VALUES ('#ProductTitle#',5,1)
    </CFQUERY>

    <CFQUERY datasource="mysite" Name="GetSample_ID">
    SELECT Product_ID
    FROM Products
    WHERE (Producttitle = '#ProductTitle#') AND (sample=1)
    ORDER BY Product_ID DESC
    </CFQUERY>

    <CFOUTPUT query="GetSample_ID" maxrows="1">
    <CFSET Sample_ID = "#Product_ID#">
    </CFOUTPUT>

    <CFQUERY datasource="mysite">
    UPDATE Products
    SET Sample_ID = #Sample_ID#
    WHERE (Producttitle = '#ProductTitle#') AND (sample=0)
    </CFQUERY>

    <CFLOCATION URL="index.cfm?Action=Images&ProductTitle=#Product Title#">

    </CFIF>

    <CFELSEIF IsDefined ("Table") AND Table EQ "ObjectGroups">
    <!--- Adds Subcategory to each Category --->
    <CFQUERY datasource="mysite">
    INSERT INTO ObjectGroups(Category_ID,GroupTitle)
    VALUES (1,'#GroupTitle#')
    </CFQUERY>

    <CFQUERY datasource="mysite">
    INSERT INTO ObjectGroups(Category_ID,GroupTitle)
    VALUES (2,'#GroupTitle#')
    </CFQUERY>
    <CFQUERY datasource="mysite">
    INSERT INTO ObjectGroups(Category_ID,GroupTitle)
    VALUES (3,'#GroupTitle#')
    </CFQUERY>

    <CFQUERY datasource="mysite">
    INSERT INTO ObjectGroups(Category_ID,GroupTitle)
    VALUES (4,'#GroupTitle#')
    </CFQUERY>

    <CFLOCATION URL="index.cfm?Confirm=SubCatInsert">

    </CFIF>

    rs232j Guest

  2. Similar Questions and Discussions

    1. Error Executing Database Query
      I have a website, which is visited by 18.000 unique users a day, who view almost 900.000 pages As you can see, one user views a lot of pages....
    2. Error Executing Database Query.
      The error occurred in C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutorial\index.cfm: line 2 2 : <cfquery name="atrwork"...
    3. another Error executing database query
      Just when I thought I had all my forms finely tuned, I get the error below, which has me stumped (using DrmWeaver 2004, CF7, mysql): Error...
    4. #24522 [Opn->Fbk]: MSSQL: "Changed database context to" error when running query
      ID: 24522 Updated by: fmk@php.net Reported By: cdcr440 at hotmail dot com -Status: Open +Status: ...
    5. #24522 [Fbk->Opn]: MSSQL: "Changed database context to" error when running query
      ID: 24522 User updated by: cdcr440 at hotmail dot com Reported By: cdcr440 at hotmail dot com -Status: Feedback...
  3. #2

    Default Re: Error after upgrade "Error Executing DatabaseQuery. "

    <i><CFINSERT DATASOURCE="mysite" TABLENAME="#Table#"></i>
    Probably an error. The tag assumes implicitly that a form has been submitted.
    In fact, one of its attributes is "formfields". Since you leave out the
    attribute, Coldfusion assumes it has to insert all the fields of a submitted
    form. You should put the tag within the block
    <cfif isDefined("form.someFormField")>
    </cfif>


    BKBK Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139