Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server RAISERROR function
Message
De
22/09/2004 12:01:03
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
SQL Server RAISERROR function
Divers
Thread ID:
00945047
Message ID:
00945047
Vues:
120
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform