[thelist] CF/ODBC/Access dates

jeff jeff at members.evolt.org
Fri Oct 13 03:51:44 CDT 2000


<ol>,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:  From: Oliver Lineham
:
:  i'm having trouble inserting dates into an Access
:  database via ODBC with CF.
:
:  the query basically is (for example):
:
:  INSERT INTO Thetable(thetableid, date)
:  VALUES(6, {d '2000-10-13'})
:
:  [obviously the 6 actually comes from cf_max_id,
:  and the ODBC date was generated by
:  CreateODBCDate()]
:
:  what am I doing wrong?
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

without seeing the error code that's being generated it's anybody's guess,
but my instinct tells me it's an issue with you naming a column with a
reserved word, "date".  change the name to something more descriptive of the
data that will be stored in that column and see if that doesn't work better
for ya.

also, just a word of caution with using a custom tag to get the max id from
a table.  without wrapping your call to the custom tag to get the max id and
the cfquery that performs the insert that uses that max id with
<cftransaction> tags, there is no guarantee that the max id you're getting
back has anything at all to do with the content.  in other words, you better
be doing this:

<cftransaction>
  <cf_max_id>
  <cfquery>
    INSERT INTO blah ()
    VALUES ()
  </cfquery>
</cftransaction>


good luck,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org





More information about the thelist mailing list