473,837 Members | 1,689 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2758
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='SomeT ext';" 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.5012 4$Hy3.21537@edt nps89...
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*****@hotmai l.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='SomeT ext';" 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.5012 4$Hy3.21537@edt nps89...
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
22390
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 work. The way I see it, for example, SET ContactLastName='' (two single quotes) is somehow invalidating the update, although I can't seem to find documentation on that. If this is the case, it looks like I'd have to do some major tweaking to...
3
2627
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 value to overwrite the old value, and just using the join to narrow the set. If I don't know the new value and need to select it from another unrelated table with no unique ID, can I still use an update query?
0
1146
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 made an update. The error was that one of the assembly files (one that I was updating) was in use by another process. The update only took a second where all I did was overwrite the bin directory dlls (the aspx pages and code behind never...
6
1842
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 their new password, the new password is not reflected in the respective tables and after clicking the cmdChangePW, nothing happen despite me puttin a msgbox "Password changed" after running the SQL.
6
4296
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
3528
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 renaming the duplicate records? My thinking was to take the results of the duplicate query, and somehow have it number each line where there is a duplicate (tried a groups query, but "count" won't work), then do an update query to change the duplicate to...
1
5176
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 existing make table query, my problem is it will over write an existing table. i.e when run in access a warning that you are about to overwrite an existing table will be shown and you will be prompted to accept or reject. When run via the external program...
2
2057
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 way that I need to add any text to the end of what ever is already there. I am familiar with the UPDATE syntax but I can only make this overwrite the information that is there. I need to add to the information that is there. I could get the...
2
1056
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 all users. Is there some comparable way in .Net? I'm running Visual Studio 2008. Any help will be graciously accepted! --
0
9827
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9678
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10863
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10560
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10609
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9390
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7798
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4034
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.