I just need to know whether or not the record exists, so a return of 0 if it does not exist or 1 if it does is ok
But I would rather go the SQL Stored procedures way (if it is better than the way suggested by Alan Rafael El 14/01/2011 11:39, Stephen Russell escribió: > On Fri, Jan 14, 2011 at 6:22 AM, Alan Bourke<[email protected]> wrote: >> I don't think this needs to be an SQL Server sproc, it needs to just be >> a VFP SQLEXEC() parameterised query. For example, assuming string fields >> and an existing connection : >> >> lcSQL = "select count(" + fieldname + ") as c from " + tablename + " >> where " + fieldname + "='" + value + "'" >> >> SqlExec(nHandle, lcSQL, "resultcursor", laCountInfo) >> >> > From there you can look at resultcursor or laCountInfo for the result. >> >> You might want to use SQL parameters for safety. >> >> If you want to go down the stored proc route look for "Using SQL Server >> Input/Output Parameters" in the VFP help which shows how >> to create an SP on the fly and return a value to VFP. >> -- > ------------------------ > > Could you receive a value of 0 instead of -N > > then the above will work for you. Otherwise we need to tweak the return. > > > _______________________________________________ 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.

