Solved

update db occur error code 37000

Posted on 2001-06-28
4
263 Views
Last Modified: 2013-12-24
hai,
i am using Access 97 with .mdb file called general
inside has a table called "event", with 2 datatype:
  name        format
event_name text
event_date date/time(Medium time eg. 19-Jun-94)

it doesnot show any problem when i add new record to it, but
when i update the record using query:


<CFSET eventdate = CreateDate(Form.date3, Form.date2, Form.date1)>
<CFSET event_date = DateFormat(eventdate,"dd-mmm-yyyy")>

<cfquery name="updateevent" datasource="general">
UPDATE event
     SET event_name  = '#Form.event_name#',
                event_date   = '#event_date#',
WHERE event_name = '#form.name#'
</cfquery>

it shows error message at the UPDATE query which is:
ODBC Error Code = 37000 (Syntax error or access violation)
[Microsoft][ODBC Microsoft Access 97 Driver] Syntax error in UPDATE statement.

why this happen?
0
Comment
Question by:J_J
  • 2
4 Comments
 

Accepted Solution

by:
JYnet earned 20 total points
ID: 6236919
i think only small problem...

REMEMBER NO "," AT THE LAST COMMAND OF UPDATE

:)
0
 
LVL 5

Expert Comment

by:Yog
ID: 6237053
<cfquery name="updateevent" datasource="general">
UPDATE event
SET event_name  = '#Form.event_name#',
    event_date   = '#createodbcdate(event_date)#',
WHERE event_name = '#form.name#'
</cfquery>

use createodbedate - also in the where clause use primary key
example
WHERE event_id = 1



0
 
LVL 5

Expert Comment

by:Yog
ID: 6237054
and forgpt no "'" in date
<cfquery name="updateevent" datasource="general">
UPDATE event
SET event_name  = '#Form.event_name#',
    event_date   = #createodbcdate(event_date)#,
WHERE event_id = '1'
</cfquery>


0
 

Author Comment

by:J_J
ID: 6244207
thanks, JYnet. how silly i am!
0

Featured Post

New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now