Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Checking if item already exists
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Checking if item already exists
Miscellaneous
Thread ID:
01261920
Message ID:
01261920
Views:
53
I need to know if an item is in a table before updating the table

From the table bancos.dbf I have two cursors as below, buffered
pessismist (4)


SELECT BANCOS1
BROWSE

SELECT BANCOS
BROWSE

LOCATE FOR (UPPER(BANCO) = UPPER(THISFORM.TEXT1.Value)

IF FOUND ()
= MESSAGEBOX ("The record already exists")
RETU
endif

= MESSAGEBOX ("uptade")
SELECT bancos1
TABLEUPDATE()
THISFORM.Release

At the first time it works fine, because as in browse test
the new item only appear in bancos1 and not in bancos


The problem is that if the item already exists,
then it always will repeat "item already exists" even
if I type a completely differente item

It looks like it accour an inversion, because the item
is not shown in bancos1 but is shown in bancos

So, I have the false menssage that the item already exist

Moises
Next
Reply
Map
View

Click here to load this message in the networking platform