I mean number  :)

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 10:52 AM
To: CF-Talk
Subject: RE: Insert Into Query Bombing Out - What Am I Not Seeing?


If your ListID is a PrimaryKey field, you will not be able to insert a value
into it.  Make sure this field in Access is an int.

HTH 

kevin

-----Original Message-----
From: Chris Montgomery [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 10:46 AM
To: CF-Talk
Subject: Insert Into Query Bombing Out - What Am I Not Seeing?


Howdy,

This should be an easy one and I'm a bit embarassed to ask about it, but I'm
not seeing something.

I want to loop over a list of numbers and do a query Insert Into for each
item in the list. This is what I have:

(Form.GroupList is a list of numbers, e.g., 5,7,6,3,8,2,1,4)

<cfset Counter = 0>
<cfloop list="#Form.GroupList#" index="i">
  <cfset Counter = #counter# + 1>
  <cfquery name="AddMessage#counter#" datasource="operoutcry">
    insert into Messages (ListID, From, Subject, MsgBody)
    values(#Val(i)#, '#form.from#', '#form.subject#', '#form.msgbody#')
  </cfquery>
</cfloop>

(the form.from, form.subject, and form.msgbody fields will be the same for
each insertion)

I'm getting a syntax error:

Diagnostic error message: ODBC Error Code = 37000 (Syntax error or access
violation)

[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO
statement.

SQL = "insert into Messages (ListID, From, Subject, MsgBody) values(5, 'Joe
Blow', 'Test', 'enter email message here this is a test')"

Using MS Access to do this. What am I not seeing?

TIA,

Chris Montgomery             [EMAIL PROTECTED]

Web Development & Consulting http://www.astutia.com
Allaire Consulting Partner
210-490-3249/888-745-7603    Fax 210-490-4692
AIM: astutiaweb; ICQ: 7381282
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to