Subject Re: [IBO] is it my ib_query or ib_grid is slow?
Author james_027
here is my setup... please advice me if I have done something wrong.


object usage: TIB_Query
DatabaseName = 'D:\Works\KSK\database\ACCTDB.GDB'
FieldsDisplayFormat.Strings = (
'"RequestDate"=mmmm d, yy'
'"RequestTime"=hh:mm AM/PM'
'"Qty"=0.00')
FieldsDisplayLabel.Strings = (
'"RequestDate"=Date'
'"Source"=From'
'"Destination"=To')
FieldsDisplayWidth.Strings = (
'"Qty"=60'
'"UseIn"=120'
'"Source"=100'
'"Destination"=100'
'"Request"=80'
'"RequestDate"=80'
'"RequestTime"=80'
'"Unit"=60'
'"Remarks"=100'
'ID=40'
'"Use"=60'
'"ItemName"=100')
FieldsIndex.Strings = (
'ID'
'"RequestDate"'
'"RequestTime"'
'"ItemID"'
'"Purpose"'
'"ItemName"'
'"Qty"'
'"Unit"'
'"Request"'
'"Source"'
'"Destination"'
'"Use"'
'"Remarks"'
'"Status"'
'"From"'
'"To"')
FieldsVisible.Strings = (
'"ItemID"=FALSE'
'"Purpose"=FALSE'
'"From"=FALSE'
'"To"=FALSE'
'"Status"=FALSE'
'"UseIn"=TRUE')
IB_Connection = Form_main.IB_Connection1
SQL.Strings = (
'select m.*,'

' (select "Name" from "items" d where d.ID = m."ItemID")
as "It' +
'emName",'

' (select "Warehouse" from "warehouse" d3 where
d3.ID=m."From"' +
') as "Source",'

' (select "Warehouse" from "warehouse" d4 where
d4.ID=m."To") ' +
'as "Destination"'
''
'from "usage" m'
'where ("Status" != :paramstatus) '
'')
OnPrepareSQL = usagePrepareSQL
ColorScheme = False
EditSQL.Strings = (
'UPDATE "usage" SET'
' ID = :ID, /*PK*/'
' "RequestDate" = :"RequestDate",'
' "RequestTime" = :"RequestTime",'
' '
' "Purpose" = :"Purpose",'
' '
' "Unit" = :"Unit",'
' "Request" = :"Request",'
' "Remarks" = :"Remarks",'
' "Status" = :"Status",'
' "From" = :"From",'
' "To" = :"To"'
'WHERE'
' ID = :OLD_ID')
KeyLinks.Strings = (
'ID')
MasterSource = ds_items
MasterLinks.Strings = (
'"usage"."ItemID"="items".ID')
MasterSearchFlags = [msfOpenMasterOnOpen,
msfSearchAppliesToMasterOnly]
OrderingItemNo = 1
OrderingItems.Strings = (

'"RequestDate"="RequestDate","RequestTime";"RequestDate"
DESC, "R' +
'equestTime" ASC')
OrderingLinks.Strings = (
'"RequestDate"=ITEM=1')
BufferSynchroFlags = []
FetchWholeRows = True
Left = 702
Top = 120
end





object IB_Grid2: TIB_Grid
Left = 0
Top = 271
Width = 770
Height = 216
CustomGlyphsSupplied = []
DataSource = ds_usage
Align = alClient
Color = clWhite
TabOrder = 3
RowSelect = True
OnGetCellProps = IB_Grid2GetCellProps
end