472,374 Members | 1,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 2692
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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.