473,387 Members | 1,624 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,387 software developers and data experts.

conditional query in access db

Hello,

In access db (2002),
How can I make the equivalent :

something like the pseudo code :

if not exists (
select ... from table_name) then
insert into table...
else
update table.
In Oracle it is :
begin
update table where id = ...
if sql%notfound then
insert into ...
end if;
end;

How can I do the above in MS-Access.

Need sample code, please.

Thanks :)
May 24 '06 #1
1 1981
You cannot do this in a single Access query. The equivalent Microsoft tool
for Oracle is SQL Server, in which you would use T-SQL and write a very
similar stream of SQL/T-SQL to what you posted.

To do something similar in Access, you will have to write some VB. One
approach would be to create a form dedicated to this process, with a button
that starts it. Inside the module you could use VB to test the conditions
you're looking at and then either run saved Access queries or execute the
SQL directly off the database object with .EXECUTE.

In access db (2002),
How can I make the equivalent :

something like the pseudo code :

if not exists (
select ... from table_name) then
insert into table...
else
update table.
In Oracle it is :
begin
update table where id = ...
if sql%notfound then
insert into ...
end if;
end;

How can I do the above in MS-Access.

Need sample code, please.

Thanks :)

May 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
3
by: B Love | last post by:
I would like to display a drop-down list on a form conditional on the value of another field on the same form. I am not sure if this is good form or not. I am using Access97, but have access to...
5
by: John Baker | last post by:
Hi: I have a field that i wish to use the conditional format capability on, and for some reason it wont work. The field is a a text box: =- I would like to make it red when negative, and...
1
by: Stuart Round | last post by:
What condition do I need to use to stop a macro when no value is returned? In the querie there is no empty box, just the field names, and the form relating to it appears blank? I have various...
0
by: Paul T. Rong | last post by:
I don't know why that I lost track of the post. I found it from the newsgroup and paste last two posts. Pieter Linden said: "To do this - use conditional formatting..." I didn' work it out....
3
by: Chuck Reed | last post by:
I am working on a sales report where I show weekly sales by category for each of the 52 weeks in the year. Each record in my table/report has the 52 weeks of sales in it. I want to highlight to top...
2
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold...
1
by: Martin Schneider | last post by:
Hi! I have an unbound text field conditionally formatted: =DomWert("";"ActiveLines") (DomWert is the german translation for domain value) (to check whether the currend record is within...
5
by: googleboy | last post by:
I am trying to create a query that will perform a set of queries in a sequence. If the results of the first query are null, then I want the query to continue to the next query. In all, I believe the...
4
by: midlothian | last post by:
Hello, I have conditional formatting set up on a subform based on a calculated value in the underlying query. For instance, if Sales are >$1000, the query displays "Yes," otherwise it displays...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.