Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL passthrough when error is a unique key violation.
Message
 
À
30/05/2001 16:36:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00512889
Message ID:
00512960
Vues:
11
I am not sure I understand this, but I am working on a very similar function right now(just starting it actually)

It looks like you want the error information written back to the server, which just denied your last sql insert or update statment... and you got back error -01
did you use aerror() to see what that error actually was.... I assume you did, as you mentioned that you know its a unique key violation.

now that you know that... just a suggestion, but you might try
sqldisconnect(connectionhandle)
then reconnect as ... and issue a sqlpassthrough to write the error to your sql table...

Let me know if that works.... I have not written it yet. but it seems that it should.

Bob Lee


>Has anyone had this problem. I am testing my error traping one test I set up is a test that will create a unique key violation. I do this through a passthrough.
>
> I run the test I get a return of -1 and the error message says I have violated a unique key constraint, this is good.
>
> The problem is, the passthrough will not let go of the last error.
>I use a passthrough to write this error to an error table I have created, but it will not write to the table because the unique key violation is still in effect.
>
> How do I get ODBC to let go of this unique key error and use the passthrough to write this error message to my error table.
In the beginning, there was a command prompt, and all was well.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform