Ask a Question related to Coldfusion Server Administration, Design and Development.
-
rs232j #1
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
-
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.... -
Error Executing Database Query.
The error occurred in C:\CFusionMX7\wwwroot\CFIDE\gettingstarted\tutorial\index.cfm: line 2 2 : <cfquery name="atrwork"... -
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... -
#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: ... -
#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... -
BKBK #2
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



Reply With Quote

