Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Connections
Message
 
À
04/02/2003 15:55:09
Fabian Valencia
Calamos Asset Managment Inc.
Naperville, Illinois, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Divers
Thread ID:
00749060
Message ID:
00749201
Vues:
24
>I'm trying to roll back all pending changes to SQL, unfortunately I can't find a command that gives all valid connections to SQL.
>I was thinking on running something that looks like this:
>
>FOR n = 1 TO 100
> ? SQLGETPROP(n,"ConnectString")
>ENDFOR
>
>but it crashes if the connection is not valid, and on top of that this code was going in my error handler so I can't execute it becasue it will generate a foxpro error since at that point foxpro cancels the error handler, so I don't have control over that code.
>
>Something I'm missing?
>
>Thanks for any help.
>Fabian
To get around the error, you could use:
on error lNotAConn = .T.
FOR n = 1 TO 100
   ? SQLGETPROP(n,"ConnectString")
ENDFOR
Having said that. I tend to agree with Jon. If you could have all your updates on the same connection then a single transaction will take care of the whole thing (commiting all/rolling back all) - which is the purpose of having transacions built-in the DBMS. But perhaps your scenario does not allow for what. Your call.
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform