....
//Ex
USE "MYTABLE" // 10.000.000 RECS with SET RECORDSET OPEN WHERE CLAUSE TO will load only 51.000 recs
....
// Here we will need other set of data
//we have to be sure that with this new query our app code can run all necessary routines
nRecno := RECNO()
cOldSql := ADOWHERECLAUSE( SELECT(), "INVOICEDATE > '2016/04/01'" )
//working with the new set
//all workarea data, indexes etc continue exactly the same
//finish working get back to previous set
ADOWHERECLAUSE( SELECT(), cOldSql )
GO nRecno
....
SET ADO PRE OPEN THRESHOLD TO 0 MASK {"MYTABLE","MYTABLE2"}
REQUEST DBFCDX
REQUEST ORDKEYNO
REQUEST ORDKEYCOUNT
REQUEST ORDKEYGOTO
REQUEST ADORDD, ADOVERSION, RECSIZE
FUNCTION MAIN()
RddRegister("ADORDD",1)
RddSetDefault("ADORDD")
SET DATE TO BRIT
SET CENTURY ON
SET EPOCH TO (YEAR(DATE())-50)
SET DELETED ON
SET SOFTSEEK OFF
IF RDDSETDEFAULT() == "ADORDD"
SET ADODBF TABLES INDEX LIST TO {{"SLGRUP",{"SLGRUP1","STRZERO(GRU_COD,3)"},{"SLGRUP2","GRU_DES"}},;
{"SLSGRU",{"SLSGRU1","STRZERO(SGR_COD,3)"},{"SLSGRU2","SGR_DES"}} }
SET ADODBF MULTIBAG INDEX LIST TO {{"SLGRUP",{"SLGRUP1","SLGRUP2"}},;
{"SLSGRU",{"SLSGRU1","SLSGRU2"}} }
SET ADO TEMPORAY NAMES INDEX LIST TO {"TMP","TEMP"}
SET ADO INDEX UDFS TO {"IF","&","SUBSTR","==","DESCEND","MYFUNC","PAD"}
SET ADODBF INDEX LIST FIELDTYPE NUMBER TO { {"SLGRUP",{"GRU_COD",3}} }
//SET ADO TABLES DECIMAL FIELDS LIST TO {}
//SET ADO TABLES LOGICAL FIELDS LIST TO {};
SET ADO DEFAULT RECNO FIELD TO "ID"
//SET ADO FIELDRECNO TABLES LIST TO {{"SLGRUP","ID"}}
SET ADO DEFAULT DELETED FIELD TO "HBDELETE"
//SET ADO FIELDDELETED TABLES LIST TO {{"SLGRUP","HBDELETE"}}
SET ADO FORCE LOCK ON
SET ADO LOCK CONTROL SHAREPATH TO HB_DIRBASE()+"TEMP" RDD TO "DBFCDX"
SET ADO DEFAULT DATABASE TO "dbfnew" SERVER TO "localhost" ENGINE TO "MYSQL" USER TO "new" PASSWORD TO "123"
// with thsi set the path becomes part of the table name.
SET ADO TABLENAME WITH PATH OFF
// uploaded with one path working now with another
SET ADO ROOT PATH TO HB_DIRBASE()+"DADOS" INSTEAD OF HB_DIRBASE()
SET ADO CACHESIZE TO 100 ASYNC ON ASYNCNOWAIT ON
SET ADO PRE OPEN THRESHOLD TO 5000 //MASK { "TABLE" }
SET EXCLUSIVE OFF
SET AUTORDER TO 1
SET AUTOPEN ON
hb_AdoUpload( HB_DIRBASE()+"DADOS\" , "DBFCDX" , "MYSQL", .f. )
ENDIF
USE SLGRUP ALIAS "SLGRUP" VIA "ADORDD" NEW
USE SLSGRU ALIAS "SLSGRU" VIA "ADORDD" NEW
RETURN .T.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 33 guests