Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling ODBC Errors with CursorAdapter
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00797306
Message ID:
00797349
Vues:
20
If you send an UPDATE SQL that looks like:

UPDATE MyTable Set Field1 = 'somevalue' where PKField = 99392

The SQL syntax is 100% correct as long as there is a MyTable, Field1 and it accepts the right data submitted to it, and PKField exists. However, if there is no record where PKField = 99392, no records get updated. This is NOT an error just because you have no matching records. So TABLEUPDATE() will indeed return TRUE. To expect anything different is not realistic when dealing with remote data using SQL commands.

If the DB is SQL Server, I believe you have to issue a subsequent SQL to query the @@ROWCOUNT to see how many rows got updated or deleted. For Oracle, you have to use Stored Procs to do the UPDATE/DELETE commands for you in order to get a row count returned.

>I would do it too, but it doesn't work, TableUpdate() always return .T. in any update error. I test it by myself too... Here's Focus Magazine say's about it...
>
>"As with the native CursorAdapter, most errors are trappable in the "traditional" way ? test the return value of TableUpdate and, in case of failure, use AError to determine the cause. Unfortunately, the detection of an update conflict is also a problem for the ODBC type CursorAdapter."
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform