Expert Software Company : News

vineri, 23 iulie 2010

CA - Cursor Adapter

CLEAR ALL

PUBLIC XC
XC= SQLSTRINGCONNECT("Driver={SQL Server Native Client 10.0}; Server=vicos-pc\sqlicas;database=test2010;Trusted_connection=yes;")

LOCAL aa as CursorAdapter

SIC="%531%"
aa= CREATEOBJECT("CursorAdapter")
aa.datasource=xc
aa.DataSourceType="ODBC"
aa.AllowDelete =.T.
aa.Allowinsert=.T.
aa.AllowUpdate =.T.
aa.SelectCmd ="SELECT * from Conturi WHERE cont LIKE ?SIC "
aa.Alias="test"
aa.BufferModeOverride=5

IF !aa. CursorFill()
WAIT WINDOW SYS(2018)
RETURN .F.
ENDIF


BEGIN TRANSACTION

SELECT test
i=1
SCAN
IF i=10
EXIT
ENDIF
REPLACE cont WITH "VICOS_CA_TEST"
i = i + 1
ENDSCAN

IF !TABLEUPDATE(.T.)
MESSAGEBOX("EROARE: Actualizarea a esuat!", 16, "Eroare")
ENDIF
BROWSE

ROLLBACK
BROWSE

SQLDISCONNECT(xc)

Niciun comentariu:

Trimiteți un comentariu