Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple SQL question fro MS-Access

Status
Not open for further replies.

mattygriff

Programmer
May 14, 2001
350
GB
Is there a simple way to update an existing field in an Access database other than deleting the existing record and adding a new one? Also, what is the simplest way to delete a record from an Access database using SQL.

I know these are very basic questions but I'm a pretty stupid guy.

Thanks.
 
Hiya,

To update a field in Access using SQL, you need to run

UPDATE <table_name>
SET field_name = new_value
WHERE field_name = old_value

plus anything else you need in the where clause to restrict the rows that are being updated to those that you want done.

To delete in Access, you run

DELETE <table_name>
WHERE field_1 = xyz
AND field_2 = xyza

Put whatever needed into the where clause to ensure that only the row you want deleted from Access is done.

HTH

Tim
 
Thanks Tim1. I felt almost embarrassed asking such a simple question but now I'm glad I did.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top