Thanks everyone for the help!

Scott

> -----Original Message-----
> From: Michael Kear [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 10, 2003 1:32 PM
> To: CF-Talk
> Subject: RE: HELP PLEASE!!!!
> 
> 
> IF you're using SQLServer, it's very finicky about double and single
> quotes.  Double quotes in your values means for SQL to set the values
> equal to the column name .. e.g.  set the column LastName equal to the
> column 11. But of course you don't have a column called 11.
> 
> However single quotes tell SQL to set the column equal to the 
> value 11. 
> 
> Therefore, I think your problem is solved if you change your code to: 
> 
> <cfquery name="InsertStaff" datasource="SLL_Staff" dbtype="ODBC">
>  UPDATE Staff
>  SET LastName = '#form.lname#',
>   FirstName = '#form.fname#', 
>   Building = '#form.bldg#', 
>   DeptCode = '#form.dept#', 
>   Job = '#form.job#', 
>   Extension = #form.ext#, 
>   [Alternate Phone] = #form.aphone#,
>   [Alt  Extension] = #form.aext#, 
>   Email = '#form.email#', 
>   GroupCode = #form.group#, 
>   FTE = '#form.fte#', 
>   SupevisorID = #form.sup#
>  WHERE ID = #URL.id#
>  </cfquery>
> 
> And you had better check the other case too - where you have 
> no  quotes
> at all.  They should be single quotes too I think.
> 
> 
> Not sure why the error message is so vague.  Probably because SQL
> doesn't give ColdFusion back much to work with, but it is very obtuse
> and would be far better if it told you more about what it was
> complaining about.
> 
> 
> Cheers,
> Michael Kear
> Windsor, NSW, Australia
> AFP Webworks.
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Scott Wilhelm [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, 11 March 2003 5:08 AM
> To: CF-Talk
> Subject: HELP PLEASE!!!!
> 
> I keep getting the following error:
>  
> 
> Error Diagnostic Information
> 
> 
> ODBC Error Code = 37000 (Syntax error or access violation) 
> 
> 
> 
> [Microsoft][ODBC Microsoft Access Driver] Invalid bracketing of name
> '[EMAIL PROTECTED]'. 
> 
> 
> 
> SQL = "UPDATE Staff SET LastName = "11", FirstName = "21", Building =
> "West Side Elementary", DeptCode = "09", Job = "3", Extension = 4,
> [Alternate Phone] = 3864504, [Alt Extension] = 5, Email = "[EMAIL PROTECTED]",
> GroupCode = 4, FTE = ".50", SupevisorID = 25 WHERE ID = 1137" 
> 
> 
> Data Source = "SLL_STAFF" 
> 
> 
> 
> The error occurred while processing an element with a general 
> identifier
> of (CFQUERY), occupying document position (9:2) to (9:66).
> 
> 
> Date/Time: 03/10/03 13:06:54
> Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR
> 1.0.3705)
> Remote Address: 163.153.8.144
> HTTP Referrer:
> http://admin.sllboces.org/tools/staff_directory.cfm?id=1137
> Query String: a=update&id=1137
> 
>  
> With this code:
>  
>  <cfquery name="InsertStaff" datasource="SLL_Staff" dbtype="ODBC">
>  UPDATE Staff
>  SET LastName = "#form.lname#", 
>   FirstName = "#form.fname#", 
>   Building = "#form.bldg#", 
>   DeptCode = "#form.dept#", 
>   Job = "#form.job#", 
>   Extension = #form.ext#, 
>   [Alternate Phone] = #form.aphone#,
>   [Alt  Extension] = #form.aext#, 
>   Email = "#form.email#", 
>   GroupCode = #form.group#, 
>   FTE = "#form.fte#", 
>   SupevisorID = #form.sup#
>  WHERE ID = #URL.id#
>  </cfquery>
>  
> Can someone tell me what I'm doing wrong?  I know all the fields are
> correct, and the FORM requests are too...
>  
> Thanks,
>  
> Scott
> 
> Scott Wilhelm
> Computer Technician/Web Developer
> http://www.sllboces.org <http://www.sllboces.org/> 
> [EMAIL PROTECTED]
> 
> Canton (Mon/Tue)
> St. Lawrence-Lewis BOCES
> PO Box 231, 139 State Street Road
> Canton, NY 13617
> P.   315-386-4504 x 164
> F.   315-386-3395
> 
> Heuvelton (Wed/Thu/Fri)
> Heuvelton Central School
> PO Box 375, 87 Washington Street
> Heuvelton, NY 13654
> P.   315-344-2414 x 3651<?xml:namespace prefix = o ns =
> "urn:schemas-microsoft-com:office:office" />
> 
>  
>  
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to