Subject Query OrderingLinks POS - program never ends
Author Michael Horne

Hello,

 

I am upgrading a program from delphi7, ibo v4.8 to the newest ibo v5.5.5.

 

I noticed that sometimes my programs where not exiting, I started digging

into what is going on and found that if I opened a query or changed to a

order that had used a “OrderingLinks” with “POS” then when the program

tries to close it stays on the TaskBar and doesn’t stop running, I must go into

TaskManager and kill it.

 

I checked an I am closing the query, I checked multiple queries where I had

the POS and all did the same thing.  The queries that didn’t use the POS worked

as expected.  I have included dfm code samples below.

 

Thanks

Michael Horne

 

--- Sample 1

 

object qyWarehouse: TIB_Query

  IB_Connection = formIBData.cnMain

  SQL.Strings = (

    'select wh_id, wh_Company, wh_Descr, wh_Location,'

    '    wh_fontColor, wh_BackColor,'

   

      '    cast(( case cwh_omit when 1 then 1 else 0 end) as t_boolean)' +

      ' omit'

    'from warehouse '

   

      'left join customer_wh on wh_id = cwh_wh_id and cwh_cus_id = :cus' +

      '_id'

    'where wh_hide = '#39'F'#39)

  AutoFetchAll = True

  KeyLinks.Strings = (

    'warehouse.wh_id')

  MasterSource = dsCustomer

  OrderingItemNo = 2

  OrderingItems.Strings = (

    'WH_ID=WH_ID;WH_ID DESC'

    'WH_COMPANY=WH_COMPANY;WH_COMPANY DESC'

    'WH_DESCR=WH_DESCR;WH_DESCR DESC'

    'WH_LOCATION=WH_LOCATION;WH_LOCATION DESCR')

  OrderingLinks.Strings = (

    'WH_ID=ITEM=1;POS=1'

    'WH_COMPANY=ITEM=2;POS=1'

    'WH_DESCR=ITEM=3;POS=1'

    'WH_LOCATION=ITEM=4;POS=1')

  RequestLive = True

  Left = 484

  Top = 363

end

 

--- Sample 2

 

object IB_Query1: TIB_Query

  IB_Connection = formIBData.cnMain

  SQL.Strings = (

    'SELECT OM_ID'

    '     , OM_CUS_ID'

    '     , OM_INVNUM'

    '     , OM_COMPANY'

    '     , OM_STATUS'

    '     , OM_INVDATE'

    '     , om_realdate'

    '     , (select Total'

    '        from spOrderCalculate(ORDERSM.om_id)) as Total'

    '/*'

    '     , (select TOTSALES'

    '        from spOrderCalculate(ORDERSM.om_id)) as TOTSALES'

    '*/'

    '     , (select SALESTAX'

    '        from spOrderCalculate(ORDERSM.om_id)) as SALESTAX'

    '     , (select TOTCUSTOMERFREIGHT'

    '        from spOrderCalculate(ORDERSM.om_id)) as FREIGHT'

    '/*'

    '     , (select TOTMisc'

    '        from spOrderCalculate(ORDERSM.om_id)) as MiscChg'

    '*/'

    '     , OM_SALESPERSON'

    '     , (SELECT first 1 NC_DATETIME from NetComQuote'

    '          left join netcomin on nc_id = ncq_nc_id'

    '          where (ncq_om_id = ordersM.om_ID)'

    '          and (NC_Status <> '#39'D'#39')'

    '          order by nc_DateTime desc) as nc_DateTime'

    '     , om_reviewed'

    '     , OM_REVIEWED_SALESPERSON'

    '     , OM_SALESMANAGER'

    '     , OM_CUSTSEARCH'

    '     , OM_SESSION_ID'

    '     , OM_SESSION_USERNAME'

    '     , OM_PONUM'

    '     , OM_REFNUM'

    '     , OM_SEARCHNOTES'

    '     , OM_NC_REPLIES_DATETIME'

   

      '     , (select CUS_RATING from customer where om_cus_id = cus_id' +

      ') as cus_rating'

   

      '     , (select first 1 RAM_ID from ramaster where om_id = ram_om' +

      '_id order by ram_id) as ram_id'

   

      '/*     , (select first 1 REPLIES_CODE from SPORDER_CHECK_NC_REPL' +

      'IES(ORDERSM.om_id)) as replies_code */'

    'FROM ORDERSM')

  EditSQL.Strings = (

    'UPDATE ORDERSM SET'

    '   OM_REVIEWED = :OM_REVIEWED'

    'WHERE'

    '   OM_ID = :OLD_OM_ID')

  KeyLinks.Strings = (

    'OrdersM.OM_ID')

  MasterSearchFlags = [msfOpenMasterOnOpen, msfSearchMasterOnSearch, msfSearchAppliesToMasterOnly]

  OrderingItemNo = 1

  OrderingItems.Strings = (

    'Quote=OM_ID desc; OM_ID'

    'InvNum=OM_InvNum desc, OM_ID desc; OM_InvNum, OM_ID'

   

      'CustNum=OM_Cus_ID desc, OM_Company desc, OM_ID desc; OM_Cus_ID, ' +

      'OM_Company, OM_ID'

   

      'Company= OM_Company desc, OM_Cus_ID desc, OM_ID desc; OM_Company' +

      ', OM_Cus_ID, OM_ID'

    'SalesPerson=OM_ID desc; OM_ID'

    'InvDate=OM_INVDATE, om_id; OM_INVDATE desc, om_id desc'

   

      'SalesManager=OM_SALESMANAGER desc, om_id desc; OM_SALESMANAGER, ' +

      'om_id'

    'RefNum=OM_Refnum, om_id desc; om_refnum desc, om_id desc'

   

      'SalesPerReview=OM_REVIEWED_SALESPERSON, om_id desc; OM_REVIEWED_' +

      'SALESPERSON desc, om_id desc ')

  OrderingLinks.Strings = (

    'OM_ID=ITEM=1;Pos=6'

    'OM_InvNum=ITEM=2;Pos=5'

    'OM_Cus_ID=ITEM=3;Pos=4'

    'OM_Company=ITEM=4;Pos=1'

    'OM_SalesPerson=ITEM=5;Pos=1'

    'OM_INVDATE=ITEM=6;Pos=8'

    'OM_SALESMANAGER=ITEM=7;Pos=1'

    'OM_REFNUM=ITEM=8;pos=1'

    'OM_REVIEWED_SALESPERSON=ITEM=9;pos=1')

  RefreshAction = raKeepDataPos

  SearchingLinks.Strings = (

    'OM_ID=Quote'

    'OM_InvNum=InvNum'

    'OM_Cus_ID=Cus_ID'

    'OM_Company=Company'

    'OM_SalesPerson=SalesPerson'

    'OM_INVDATE=InvDate'

    'OM_SALESMANAGER=SalesManager')

  BufferSynchroFlags = [bsAfterEdit, bsAfterInsert]

  Left = 344

  Top = 232

  ParamValues = (

    'OLNK_OM_ID=00000080')

end