Probably because the distrib_id field is of type integer.  Try removing the
quotes around it in the where clause so you've got:

WHERE distrib_id = #distrib_id#

------------------------------------------------------------------ 
Andrew Ewings
Project Manager
Thoughtbubble Ltd 
http://www.thoughtbubble.net 
------------------------------------------------------------------ 
United Kingdom 
http://www.thoughtbubble.co.uk/ 
Tel: +44 (0) 20 7387 8890 
------------------------------------------------------------------ 
New Zealand 
http://www.thoughtbubble.co.nz/ 
Tel: +64 (0) 9 419 4235 
------------------------------------------------------------------ 
The information in this email and in any attachments is confidential and
intended solely for the attention and use of the named addressee(s). Any
views or opinions presented are solely those of the author and do not
necessarily represent those of Thoughtbubble. This information may be
subject to legal, professional or other privilege and further distribution
of it is strictly prohibited without our authority. If you are not the
intended recipient, you are not authorised to disclose, copy, distribute, or
retain this message. Please notify us on +44 (0)207 387 8890. 



-----Original Message-----
From: Michael Wilson [mailto:[EMAIL PROTECTED]]
Sent: 23 October 2000 17:45
To: CF-Talk
Subject: SQL UPDATE question (was Update Query/Output question from a
newbie)


Hi again to everyone,

I would like to thank Stephen and Bret for their help earlier. I managed to
get things working on the update form, although I haven't moved to the
state_id rather than the state_name system yet. I still receive errors
(ColdFusion was unable to determine the value of the parameter) with
#selected_var# using Steven's method, but Bret's works fine.

Now I have yet another problem on my update action page and although I am
learning SQL at the moment I don't have enough knowledge to understand what
I should do here.

I would like to note that <CFUPDATE DATASOURCE="dbcms"
TABLENAME="tbldistrib">, works great. I would, however, like to learn the
proper SQL for the update action because I have been told that it is much
better than CFUPDATE. Please correct me if I am mistaken.

Any help with this will be much appreciated.

My Query is as follows:

<CFQUERY  DATASOURCE="dbcms">
UPDATE tbldistrib
SET distrib_name='#Form.distrib_name#',
        distrib_city='#Form.distrib_city#',
        distrib_state='#Form.distrib_state#',
        distrib_phone='#Form.distrib_phone#'
WHERE distrib_id = '#distrib_id#'
</CFQUERY>

I have a hidden field in my update form for the distributor ID:

<INPUT TYPE="hidden" NAME="distrib_id" Value="#distrib_id#">

The error I receive is:

ODBC Error Code = 22005 (Error in assignment)
[Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria
expression.

SQL = "UPDATE tbldistrib SET distrib_name='Calico Corners III',
distrib_city='Charlston', distrib_state='SOUTH CAROLINA',
distrib_phone='555-555-5555' WHERE distrib_id = '31'"
Data Source = "DBCMS"

The error occurred while processing an element with a general identifier of
(CFQUERY), occupying document position (2:1) to (2:29) in the template file
c:\inetpub\wwwroot\cms\updatedata.cfm.

Thanks for your time,
Mike

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to