By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,124 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,124 IT Pros & Developers. It's quick & easy.

Update Query Overwrite?

P: n/a
I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already
exists. Is there any way to change this?
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Forgot to mention... I'm using the DAO.Execute method...

I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already
exists. Is there any way to change this?

Nov 12 '05 #2

P: n/a
Brandon M,
Not enough info in your post to say. Generally, a statement like "UPDATE
FOO_TBL SET COLUMN_1='SomeText';" is a bad idea because every row in FOO_TBL
will show the value 'SomeText' in COLUMN_1. Usually a WHERE clause is used
to limit the update to the intended rows. By implication it seems that your
statement does limit the effected rows with a WHERE clause but your e-mail
doesn't clearly define what you mean by "in which the key already exists."
One interpretation is a WHERE clause that reads something like, "WHERE
KEY_COLUMN IS NULL;" which would have the effect you write about. If that
is the case, either remove the WHERE clause altogether so every row is
changed or figure out what it should be so you only change the intended
rows.

"Brandon M" <aw*****@telus.net> wrote in message
news:uX8_b.50124$Hy3.21537@edtnps89...
I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already
exists. Is there any way to change this?

Nov 12 '05 #3

P: n/a
I'm sorry... I meant an append query... too much in my head right now!!

"Alan Webb" <kn*****@hotmail.com> wrote in message
news:hj*****************@news.uswest.net...
Brandon M,
Not enough info in your post to say. Generally, a statement like "UPDATE
FOO_TBL SET COLUMN_1='SomeText';" is a bad idea because every row in FOO_TBL will show the value 'SomeText' in COLUMN_1. Usually a WHERE clause is used to limit the update to the intended rows. By implication it seems that your statement does limit the effected rows with a WHERE clause but your e-mail
doesn't clearly define what you mean by "in which the key already exists."
One interpretation is a WHERE clause that reads something like, "WHERE
KEY_COLUMN IS NULL;" which would have the effect you write about. If that
is the case, either remove the WHERE clause altogether so every row is
changed or figure out what it should be so you only change the intended
rows.

"Brandon M" <aw*****@telus.net> wrote in message
news:uX8_b.50124$Hy3.21537@edtnps89...
I'm trying to get an Update Query to overwrite any records that already
exist. By default it appears to skip any records in which the key already exists. Is there any way to change this?


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.