Ducth,
Please post your set SET ADO LOCK CONTROL
Please check the Lucas post in the topic 2012 server.
#include 'adordd.ch'
#include 'fivewin.ch'
#include 'xbrowse.ch'
REQUEST ADORDD
Function main
LOCAL cSql :=""
local oDlg, oBrw, oFont, oBtn
RddRegister("ADORDD",1)
RddSetDefault("ADORDD")
//This is the same as for other rdds
SET AUTOPEN ON //might be OFF if you wish
SET AUTORDER TO 1 // first index opened can be other
SET ADO DEFAULT DATABASE TO "easyfo" SERVER TO "localhost" ENGINE TO "MYSQL" USER TO "root" PASSWORD TO "nimda"
SET ADO FORCE LOCK OFF
SET ADO DEFAULT RECNO FIELD TO "ID"
SET ADO TEMPORAY NAMES INDEX LIST TO {"TMP","TEMP"}
SET ADODBF TABLE INDEX LIST TO { {"ccrtbl",{"CCRTBL1","UPPER(TBL_LAST)"}}, ;
{"ccrgst",{"CCRGST1","GST_INTNO"}} ;
}
USE ccrgst ALIAS 'gst' NEW SHARED
USE ccrtbl ALIAS 'tbl' NEW SHARED
SET RELATION TO tbl->tbl_gstno INTO gst
tbl->(dbgotop())
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -14
DEFINE DIALOG oDlg FROM 0, 0 TO 600, 800 TITLE 'Test ADORDD' PIXEL ;
FONT oFont
@ 1, 1 XBROWSE oBrw OF oDlg ;
SIZE 350,280 PIXEL ;
FIELDS tbl->tbl_rmno, tbl->tbl_last, tbl->tbl_first, dtoc(tbl->tbl_arr), dtoc(tbl->tbl_dep) ;
HEADERS 'Room', 'Last', 'First', 'Arrival', 'Departure' ;
FIELDSIZES 50, 150, 150, 70, 70 ;
ALIAS 'tbl' ; // SORT "tbl_rmno" ;
LINES
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROWMS
oBrw:nMarqueeStyle := MARQSTYLE_HIGHLROW
oBrw:nRowDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nColDividerStyle := LINESTYLE_LIGHTGRAY
oBrw:nHeaderHeight := 26
oBrw:nRowHeight := 24
oBrw:lHScroll := .F.
oBrw:nStretchCol := STRETCHCOL_LAST
oBrw:lAllowRowSizing := .F.
oBrw:lColDividerComplete:= .T.
oBrw:CreateFromCode()
oDlg:oClient := oBrw
@ 281, 1 BTNBMP oBtn PROMPT 'Delete' OF oDlg SIZE 35, 20 PIXEL ;
2007 ;
ACTION (if(MsgYesNo('Delete : '+rtrim(tbl->Tbl_last)),tbl->(DbDelete()), ),oBrw:Refresh())
@ 281,41 BTNBMP oBtn PROMPT 'Guest Name' OF oDlg SIZE 35, 20 PIXEL ;
2007 ;
ACTION Msginfo('Guest Last : '+rtrim(tbl->Tbl_last))
ACTIVATE DIALOG oDlg CENTER
CLOSE tbl
return nil
Application
==========
Path and name : D:\V6\TADORDD\Release\test.EXE (32 bits)
Gr๖฿e : 2,948,608 bytes
Time from start : 0 hours 0 mins 57 secs
Error occurred at : 06/17/15, 17:18:15
Description : Error ADORDD/1201 Work area not indexed: GST
Stack Calls
===========
Called from : => UR_SUPER_ERROR(0)
Called from : D:\V6\AdoRdd\adordd.prg => ADO_RELEVAL(3912)
Called from : D:\V6\AdoRdd\adordd.prg => ADO_FORCEREL(3843)
Called from : D:\V6\AdoRdd\adordd.prg => ADO_GOTOP(859)
Called from : => DBGOTOP(0)
Called from : D:\V6\TADORDD\test.prg => MAIN(41)
SET ADODBF TABLE INDEX LIST TO { {"ccrtbl",{"CCRTBL1","TBL_RMNO"}}, ;
{"ccrgst",{"CCRGST1","GST_INTNO"}} ;
}
SET ADO TABLES INDEX LIST TO { {"ccrtbl",{"CCRTBL1","TBL_RMNO"}}, ;
{"ccrgst",{"CCRGST1","GST_INTNO"}} ;
}
lucasdebeltran wrote:Dutch,
You have to set both SET ADO TABLES INDEX LIST TO... and SET ADODBF TABLES INDEX LIST TO...
SET ADODBF TABLES INDEX LIST TO { {"CCRTBL",{"CCRTBL1","TBL_RMNO"}}, ;
{"CCRGST",{"CCRGST1","GST_INTNO"}} ;
}
SET ADO TABLES INDEX LIST TO { {"CCRTBL",{"CCRTBL1","TBL_RMNO"}}, ;
{"CCRGST",{"CCRGST1","GST_INTNO"}} ;
}
SET ADO TABLES INDEX LIST TO = indexes without of any clipper like expression only to be used by SQL
SET ADODBF TABLES INDEX LIST TO = indexes with the clipper like expressions needed by the app for its evaluations.
When we use &(indexkey(0)) we cant evaluate a index expression in ADO TABLES "name+dDate+nValue" we will get an error but we can issues a sql select like that.
Thus we need the ADODBF expression "name+DTOS(dDate)+STR(nValue) to do it.
The ADO indexes are for queries the ADODBF are for the normal clipper expressions to allow its evaluation.
ARRAY SPEC FOR BOTH CASES:
ATTENTION ALL MUST BE UPPERCASE
{ {"TABLE1",{"FIRST","FIRST"} }, {"TABLE2" ,{"CODID","CODID"}} }
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 38 guests