CREATE PROCEDURE dbo.sp_EmpFind ( @EmpCode CHAR(3) ) AS SET NOCOUNT ON SELECT EmpCode, EmpName FROM Employee WHERE EmpCode = @EmpCodeWhen you execute this stored procedure, the procedure will either find a matching record or it will not. In any case it will either return an empty result set (if it did not find) or a result set containing a single record (if it did find), assuming there is only a single employee with an EmpCode of '001'. Assuming you call this sproc using SQL passthru, you will have likely specified a cursor name for the returned result set in your passthru call.
SQLEXEC(nConnection, "EXEC sp_EmpFind", "Cur1")And now, your Fox code.
SELECT Cur1 IF RECCOUNT("Cur1") == 1 * We have found our employee. m.cName = Cur1.EmpName ELSE MESSAGEBOX("Invalid Code.") ENDIFHope this helps.