Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 14th, 2007, 04:39 PM
Registered User
 
Join Date: Mar 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Invalid UPDATE command

I have an Access database that I need to modify using SQL commands. I want to update a row in the Settings table, but my SQL command isn't working:
Code:
UPDATE Settings SET Value='test' WHERE Name='LastRetrievalTime';
I can retrieve data just fine using this SELECT command though:
Code:
SELECT Value FROM Settings WHERE Name='LastRetrievalTime';
Can someone tell me what is wrong with my UPDATE command?

Thanks in advance.
 
Old April 14th, 2007, 04:44 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you define " isn't working"? Do you get an error? If so, which one?

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old April 14th, 2007, 04:47 PM
Registered User
 
Join Date: Mar 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

"Syntax error in UPDATE statement."

 
Old April 14th, 2007, 04:53 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hmmm, maybe one of your columns has a reserved name? Try renaming them, or try this:

UPDATE [Settings] SET [Value]='test' WHERE [Name]='LastRetrievalTime';


Personally, I would stay away from column and table names that look like reserved words. Somehow, Settings, Value and Name all seem to sound like a system reserved word....

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
 
Old April 14th, 2007, 05:59 PM
Registered User
 
Join Date: Mar 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you, that fixed it.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Binding Update Command sober_analyst BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 7 December 30th, 2007 10:52 AM
Update command yogeshyl Oracle 0 November 28th, 2007 08:05 AM
Update command in Datagrid chnswam C# 0 March 17th, 2006 03:04 AM
Update Command In DataGrid RPG SEARCH ASP.NET 1.0 and 1.1 Basics 9 February 21st, 2005 09:20 AM
ADO Command Update hcweb Classic ASP Basics 2 January 14th, 2004 06:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.