CLEAR 
Close Databases All
Set Deleted On
Set Date Dmy
Set Century On
Set Safety Off
Set Exclusive Off

x = SQLConnect("jcsserver", "mariusm_auto","123")
?x
If x < 0
	Return
Endif
Use d:\contafin\_alfa\datean\conversie.Dbf In 0 Shared

TEXT TO lcSql NOSHOW
insert into conversie_conturi
  (cont_vechi, cont_nou, explicatie, tip_sold, se_aplica, acont_vechi, acont_nou, conversie)
values
  (?ALLTRIM(poItem.cont_vechi), ?ALLTRIM(poItem.cont_nou), ?ALLTRIM(LEFT(poItem.den_nou,100)), ?ALLTRIM(poItem.tip_sold), 1, ?ALLTRIM(poItem.acont_vech), ?ALLTRIM(poItem.acont_nou), 'ORDIN 3055/2009');
ENDTEXT

lnSucces = SQLSetprop(x,"Transactions",  2)
If lnSucces > 0
	Select conversie
	Scan For cv_an = 2010
		Scatter Name poItem
		lnSucces = SQLExec(x, lcSql)
		If lnSucces < 0
			AERROR(laeroare)
			MESSAGEBOX(laeroare(3))
			Exit
		Endif
	Endscan
	If lnSucces < 0
		Sqlrollback(x)
	Else
		Sqlcommit(x)
	Endif
Endif
SQLSetprop(x,"Transactions", 1)
SQLDISCONNECT(x)