guillermo88
Programmer
QUERY TAKES TOO LONG
I have a form with a grid
I have an invoice table.
I want to display records that match certain criteria:
First_name, last_name
I also have indices for each field first_name and last_name.
The problem that I am having is it takes too long that query and sometimes I have a message from w2k (program not responding).
By the way table is fully optimize
Here is the piece of code on the click event of the button search
=SYS(3054,12,'xx')
thisform.grid2.RecordSource = ""
SELECT COL_AGT, INV_NO, DATE, REM_TEL1, BEN_FIRST, BEN_LAST, BEN_TEL1, TOT_INV, REM_FIRST, REM_LAST;
FROM INVOICE;
WHERE INVOICE->rem_first = thisform.txtRem_first.value ;
AND INVOICE->rem_last = thisform.txtRem_last.value ;
ORDER BY invoice->rem_tel1;
INTO CURSOR C_RES
thisform.Grid2.RecordSource = 'C_RES'
thisform.Grid2.Column1.width = 50
thisform.Grid2.Column2.width = 70
thisform.Grid2.Column3.width = 70
thisform.Grid2.Column4.width = 150
thisform.Grid2.Column5.width = 150
thisform.Grid2.Column6.width = 150
thisform.Grid2.Column7.width = 150
thisform.lblRecords.Caption = ALLTRIM(STR(_TALLY)) + ' Records'
thisform.lblRemitter.Caption = ALLTRIM(C_INV->rem_first) + ' ' + C_INV->rem_last
MESSAGEBOX(XX)
This line of code in the DE is
Thisform.grid1.recordsource = “”
Thanks
I have a form with a grid
I have an invoice table.
I want to display records that match certain criteria:
First_name, last_name
I also have indices for each field first_name and last_name.
The problem that I am having is it takes too long that query and sometimes I have a message from w2k (program not responding).
By the way table is fully optimize
Here is the piece of code on the click event of the button search
=SYS(3054,12,'xx')
thisform.grid2.RecordSource = ""
SELECT COL_AGT, INV_NO, DATE, REM_TEL1, BEN_FIRST, BEN_LAST, BEN_TEL1, TOT_INV, REM_FIRST, REM_LAST;
FROM INVOICE;
WHERE INVOICE->rem_first = thisform.txtRem_first.value ;
AND INVOICE->rem_last = thisform.txtRem_last.value ;
ORDER BY invoice->rem_tel1;
INTO CURSOR C_RES
thisform.Grid2.RecordSource = 'C_RES'
thisform.Grid2.Column1.width = 50
thisform.Grid2.Column2.width = 70
thisform.Grid2.Column3.width = 70
thisform.Grid2.Column4.width = 150
thisform.Grid2.Column5.width = 150
thisform.Grid2.Column6.width = 150
thisform.Grid2.Column7.width = 150
thisform.lblRecords.Caption = ALLTRIM(STR(_TALLY)) + ' Records'
thisform.lblRemitter.Caption = ALLTRIM(C_INV->rem_first) + ' ' + C_INV->rem_last
MESSAGEBOX(XX)
This line of code in the DE is
Thisform.grid1.recordsource = “”
Thanks