Others on this list are better at sql than I am.

Select * from MyTable where cCode = MyTag

If empty(cCode)
   MESSAGEBOX('That key not found')
endif

I don't know the field you are searching on, but that is the idea. With a small 
change you could put this record into a view/file, 
etc. You could copy it to a new dbf and a lot of things like that.


----- Original Message ----- 
From: "John Weller" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, March 27, 2008 10:29 AM
Subject: RE: Question for you longtime FoxPro guys


OK - I want to position the record pointer in a table on a particular record
based on a primary key if it exists, if not I want an error message.  I
would use the code:

IF SEEK(Thisval, 'MyTable','MyTag')
*&* Do something
ELSE
MESSAGEBOX('That key not found')
ENDIF

What is the SQL I should use instead?

John Weller
01380 723235
07976 393631

> Using seek locks you into VFP. If you are starting to design a
> program now, you should consider using SQL for data access. You
> would be developing code that would work in other languages and
> databases with fewer changes.
>



[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to