Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLSERVER Rollback
Message
De
03/01/2019 03:14:42
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
SQLSERVER Rollback
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01665065
Message ID:
01665065
Vues:
78
Dear Experts,

I am using these codes, which are working fine
TEXT TO mqry noshow
	BEGIN TRANSACTION
	SELECT * FROM stop1 WITH (tablockx)
ENDTEXT
	SQLExec(m.con,mqry)

Error_found=.f. && variable to detect error

TEXT TO m.cmd NOSHOW

INSERT INTO cash_sumt(vou_no,date) values(?thisform.text1.value,
?Thisform.text3.value)
		ENDTEXT

		If SQLExec(m.con,cmd)<0
			Aerror(laerror)
			Messagebox(laerror[1,2])
			Error_found =.T.
		Endif


		If Error_found =.F.	&& No error found

			TEXT TO mqry noshow
			commit transaction
			ENDTEXT
			SQLExec(m.con,mqry)
			Messagebox("Invoice Saved",0+64,"System",3000)

               Else
                      && how to use rollback here if error found

		Endif
Please help me how to use Rollback if any error comes.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform