Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to SEEK in a view - VFP 3.0
Message
 
To
04/09/1996 11:55:55
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00007245
Message ID:
00007248
Views:
32
>I have created a remote view in my database through OBDC, and I want to be able to SEEK for a certain value (I am trying to ascertain that the index value does not exist before I try to INSERT into the database. SEEK(), my best friend for lo these many years, doesn't work. I suppose LOCATE would, but I've always thought of LOCATE as an ugly, inferior stepchild.
>
>Is there a SEEK equivalent for remote views?

Have you tried just using a select statement?

i.e. SELECT field FROM table WHERE field = m.value...

You could select that into a cursor, and if the cursor is at EOF(), the value does not exist in the table and thus can be inserted.

Another way is to attempt the insert for all cases and if it errors, check the number. ODBC should pass back a uniqueness violation error (if the field is indexed unique, that is).

A modification of the first method would be a parameterized view. The view would look in the table for all records with field = ?value.

HTH,
Scot.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform