Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving from VFP to SQL on 2 tables
Message
De
03/06/2005 01:41:18
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Saving from VFP to SQL on 2 tables
Divers
Thread ID:
01019681
Message ID:
01019681
Vues:
81
Hy everyone !

I have a VERY big problem at saving records in 2 parent-child tables .
VFP interface and SQL server. In VFP a DBC with remote views with default values and rules on fields .
The problem is that if the SQL server returns an error on the child table, the parent behaves
like fields were modified , so filed rules are triggered and executed. And I can't have that .
The algorithm is:

*****************
BEGIN TRANSACTION
IF !(TABLEUPDATE(.f.,.f.,'invoices') AND TABLEUPDATE(.t.,.f.,'details')
=AERROR(laerror)
thisform.error(laerror[1],laerror[2],lineno(1))
ROLLBACK
=SQLROLLBACK(lconnhandle)
=SQLSETPROP(lconnhandle,"Transactions",1)
RETURN .F.
ENDIF
IF SQLCOMMIT(lconnhandle)<0
=aerror(laerror)
thisform.error(laerror[1],laerror[2],lineno(1))
ROLLBACK
=SQLROLLBACK(lconnhandle)
=SQLSETPROP(lconnhandle,"Transactions",1)
RETURN .F.
ENDIF
END TRANSACTION
=SQLSETPROP(lconnhandle,"Transactions",1)

Thank you very much,
Any help will be appreciated
Mihai .
Répondre
Fil
Voir

Click here to load this message in the networking platform