Information générale
Titre:
SQL Pass-Through Asyncronous and Batch mode.
* on VFP Environment set sysmenu>options>Remote Data>FetchSize=100
* on SQL Server Database exist a Table [anyTable] with > 10000 records
_SCREEN.Cls
h=SQLSTRINGCONNECT(AnyStringConnectionSQLServer) && or SQLCONNECT(anydnsCon)
=SQLSETPROP(h,"Asynchronous",.T.),SQLSETPROP(h,"BatchMode",.T.)
SELECT 0
hStatus=SQLEXEC(h,"select*from [anyTable]","cursor")
? 'init with ', hStatus && VFP[6,7,8] hStatus = 0
DO WHILE m.hStatus=0 AND EMPTY(ALIAS())
WAIT WINDOWS "Wait data" TIMEOUT 100
hStatus=SQLEXEC(h) && If hStatus=0 -> wait SQL complete download data
ENDDO
? 'exit with ',hStatus
* on VFP[6,7] hStatus = 0 data download run
* on VFP8 hStatus = 1 data download end
BROWSE
USE
=SQLCANCEL(h),SQLDISCONNECT(h)
* On VFP6,VFP7 versions do while exit after first 100 records are downloaded
* remainder data are downloaded on background, at 100 records block at time
* On VFP8 version, all records are downloaded as soon as SQLEXEC(h) returns 1
* and time to see first data on BROWSE is long.
* If is set SQLSETPROP(h,"BatchMode",.F.) this works like in
* the previous VFP versions.
* We have very many grid filled up in asynchronous modality through of the Timers.
* We must pass in modality not Batch!? ( double check with SQLMORERESULT())
* Someone uses this modality?
* It is a bug?
Hello Fabio
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement