MID is a reserved word in Access.  Try this:

<CFQUERY name="buyplayer" datasource="#attributes.DSN#">
 UPDATE members
 SET playerslot#attributes.slot# = #attributes.PID#
 WHERE [MID] = #currentuser.MID#
</cfquery>

You should try renaming that column in the table if possible.

HTH,

Howie Hamlin - inFusion Project Manager
On-Line Data Solutions, Inc.
www.CoolFusion.com
631-737-4668 x101
inFusion Mail Server (iMS) - the World's most configurable mail server
Get your free copy of iMS POST-SE Server from CoolFusion!

----- Original Message -----
From: "Jon Ingellis" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Saturday, January 06, 2001 12:15 AM
Subject: sigh, query of mine won't work


> I'm in a quandary here.  Here is the query that is giving me fits:
>
>
>  <CFQUERY name="buyplayer" datasource="#attributes.DSN#">
>   UPDATE members
>   SET playerslot#attributes.slot# = #attributes.PID#
>   WHERE MID = #currentuser.MID#
>  </cfquery>
>
> The error I get when the program gets to this part:
>
> [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator)
in
> query expression '4'.
>
>
> The 4 in question is the attributes.PID..   The thing is, if I go into the
> code and manually change that #attributes.PID# into a 4, or any integer,
the
> query works fine.  Somehow the query pulls these single quotes out of its
> ass when it's dealing with it as a variable.  I can see why if the number
> has quotes around it, it would crash, because the PID field in the
database
> is AutoNumber, not text.  So my question is where are those quotes coming
> from??!!
>
> I hope that made sense.  Any help would be much appreciated.
>
>
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

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

Reply via email to