<cfquery  datasource="#dsn#">
           UPDATE VintageReport
           SET Yields = #Form.Yields#,
                     Rainfall = #Form.Rainfall#,
                     Sunshine = #Form.Sunshine#,
                    <cfif Len(Form.Flowering)>
                     Flowering = '#Form.Flowering#',
                    </cfif>
                    <cfif Len(Form.Veraison)>
                     Veraison = '#Form.Veraison#',
                    </cfif>
                    <cfif Len(Form.Harvest)>
                     Harvest = '#Form.Harvest#',
                    </cfif>
                     VintageReportOther = '#Form.VintageReportOther#'
           WHERE Wine_ID = #Cookie.wineid#
           </cfquery>

Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


                                                                                       
                            
                    Damien                                                             
                            
                    Gallagher            To:     [EMAIL PROTECTED]                     
                  
                    <[EMAIL PROTECTED]        cc:                                      
                                 
                    oir.net>             Subject:     [ cf-dev ] trying to update date 
field in Access             
                                                                                       
                            
                    24/02/2004                                                         
                            
                    10:38                                                              
                            
                    Please                                                             
                            
                    respond to                                                         
                            
                    dev                                                                
                            
                                                                                       
                            
                                                                                       
                            



Hi all,

I'm having a problem with updating a simple date field in MS Access.
The problem lies where I try to pass an empty string and it comes up with
an
ODBC error even though the field is NOT required.

The code is:

<cfquery  datasource="#dsn#">
           UPDATE VintageReport
           SET Yields = #Form.Yields#,
                     Rainfall = #Form.Rainfall#,
                     Sunshine = #Form.Sunshine#,
                     Flowering = '#Form.Flowering#',
                     Veraison = '#Form.Veraison#',
                     Harvest = '#Form.Harvest#',
                     VintageReportOther = '#Form.VintageReportOther#'
           WHERE Wine_ID = #Cookie.wineid#
           </cfquery>

The error output contains:

Error Code: Error Executing Database Query. [Macromedia][SequeLink JDBC
Driver]
[ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in
UPDATE
statement
SQL UPDATE VintageReport SET Yields = 60, Rainfall = 2 , Sunshine = 100 ,
Flowering = '', Veraison = '', Harvest = '', VintageReportOther = 'none'
WHERE
Wine_ID = 244
DATASOURCE IWIN02 VENDORERRORCODE -3503 SQLSTATE 42000

- where Flowering, Veraison, and Harvest are the date fields

Any ideas?
Thanks,
Damien


----------------------------------------------
This mail sent through http://www.ukonline.net

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]






-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to