Your insert problem is the use of a reserved word as a column name.  'GUID'
is a reserved word.  You can get around the problem by enclosing the
reserved word in brackets:

insert into content
   ( [guid], type_id, client_id, user_id, logdate, birthdate,
expirationdate)
values
   ( '#temp.guid#',
      #temp.content_type_id#,
      #temp.client_id#,
      #getuserid.user_id#,
      #Now()#,
      #ParseDateTime(temp.birth_date)#,
      #ParseDateTime(temp.expiration_date)#
   )

You would do well to change the column name to avoid any other potential
conflicts.

Ken Johnson

----- Original Message -----
|
| Date: Fri, 13 Apr 2001 12:28:09 -0500
| From: Geoff Hoffman <[EMAIL PROTECTED]>
| To: <[EMAIL PROTECTED]>
| Subject: Re: INSERT INTO (access mdb table) PROBLEM
| Message-ID: <[EMAIL PROTECTED]>
|
| This is so frustrating -
|
| If I comment out the table column names, everything works fine! I
| just want to be able to name the columns in the query...
|
| <cfquery name="perm_write_content" datasource="#Application.dsn#"
| dbtype="ODBC">
| INSERT INTO content(guid,
| type_id,
| client_id,
| user_id,
| logdate,
| birthdate,
| expirationdate)
| VALUES('#temp.guid#',
| #temp.content_type_id#,
| #temp.client_id#,
| #getuserid.user_id#,
| #Now()#,
| #ParseDateTime(temp.birth_date)#,
| #ParseDateTime(temp.expiration_date)#);
| </cfquery>
|
|
| FAILS WITH ODBC ERROR 37000
|
| BUT
|
| <cfquery name="perm_write_content" datasource="#Application.dsn#"
| dbtype="ODBC">
| INSERT INTO content
| VALUES('#temp.guid#',
| #temp.content_type_id#,
| #temp.client_id#,
| #getuserid.user_id#,
| #Now()#,
| #ParseDateTime(temp.birth_date)#,
| #ParseDateTime(temp.expiration_date)#);
| </cfquery>
|
| WORKS NO PROBLEM.
|
| And I am here to tell ya that I've looked at my spellings of the
| column names enough now that I promise there are no typos in the
| 1st example.
|
| Ahh, the strange and wonderful world of Microsoft products.
|
| ------------------------------
|
| End of SQL-List V1 #13
| **********************
| Archives: http://www.mail-archive.com/[email protected]/
| Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
|
|

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

Reply via email to