I have the following query that I submit from VFP80 to MSSQL-2000.
UPDATE Employees
SET ReportsTo = 5
WHERE ReportsTo = 2
IF @@ROWCOUNT = 0
BEGIN
RAISERROR('No rows were updated',16,1)
END
As you can see I want to trap the condition of no rows updated with the IF @@ROWCOUNT = 0 clause. My problem is that when I submit this query from VFP using the SQLEXEC() command and if no rows were updated by the SQL command I get an ODBC error using the AERROR(ODBCError) function. The values in the ODBCError array:
1526
Connectivity error: Unable to retrieve specific
ERROR information. Driver is probably out of resources
.NULL.
.NULL.
.NULL.
.NULL.
.NULL.
.NULL.
This doesn't seem right and I don't know if I should rely on this to determine that I had a problem or not. Am I doing something wrong or is there another way to do it?
Jim White
Time is a wonderful teacher. Unfortunately it kills all of its students.