473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Update Query Overwrite?

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
3 2738
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mason | last post by:
I have a buch of fields that I'd like to update on a form at once, but I'm having a problem with allowing fields to be blank. If any of the fields in the SQL statement are blank, the update doesn't...
3
by: deko | last post by:
I know I can use Inner Joins in an Update query like this: UPDATE DISTINCTROW tblA INNER JOIN qryA ON tblA.SomeID = qryA.SomeID SET Flag = 0 WHERE (Flag = -1); But I am specifying the new...
0
by: Stephen Brown | last post by:
I have been running an aspnet application for over a year now and have been updating without problems. This morning, a client sent me an error message that he received at the exact moment when I...
6
by: Darren | last post by:
hi y'all! i pretty much wanted to do a custom form where users can change their password to the database as they like.. the problem i encountered is that it seems that when a valid user enter...
6
by: tone | last post by:
Hi, got: ! ! How to overwrite (update) all elements of ! with Max (or latest) of ! ? I tried if with a Update-Querry - without success. Thankx
16
by: ARC | last post by:
Hello all, So I'm knee deep in this import utility program, and am coming up with all sorts of "gotcha's!". 1st off. On a "Find Duplicates Query", does anyone have a good solution for...
1
by: arcingmad | last post by:
Hi I am using the following code in a button click event to run a query stored in a .mdb file from an external geographic program ArcGIS via a jet adodb connection I have the need to run an...
2
nathj
by: nathj | last post by:
Hi, I have a field in a table that is type longtext. When a record is created there may or may not be anything that goes in here. However, it is possible for this field to be updated in such a...
2
by: =?Utf-8?B?U2hlbGRvbg==?= | last post by:
Hi! How do you update a project that's already installed on the user's machines? In VB6, I would just overwrite the exe (when everyone was out of the project) and it would change the program for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.