Page 1 of 1

SQLBROW: error Called from MAIN(69)

Posted: Tue Apr 19, 2016 2:34 am
by satmax
I try to build rthe demo sqlbrow.exe and got the following runtime error:

Code: Select all

------------------------------------------------------------------------------
ERROR LOG of "C:\dev\devbin\exp20\Samples\Sql\SQLBROW.EXE" Date: 19.04.2016 11:31:09

Xbase++ version     : Xbase++ (R) Version 2.00.656
Operating system    : Windows 10 10.00 Build 10586
------------------------------------------------------------------------------
oError:args         :
          -> VALTYPE: U VALUE: NIL
oError:canDefault   : N
oError:canRetry     : N
oError:canSubstitute: Y
oError:cargo        : NIL
oError:description  : Parameter has a wrong data type
oError:filename     : 
oError:genCode      :          2
oError:operation    : len
oError:osCode       :          0
oError:severity     :          2
oError:subCode      :          3
oError:subSystem    : BASE
oError:thread       :          1
oError:tries        :          0
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
Called from XBPCOLUMN:CREATE(325)
Called from XBPBROWSE:INSCOLUMN(989)
Called from XBPBROWSE:ADDCOLUMN(776)
Called from DC_XBPCOLUMN:INIT(2611)
Called from DC_GETLIST:READGUI(2510)
Called from DC_READGUI(113)
Called from MAIN(69)

Re: SQLBROW: error Called from MAIN(69)

Posted: Tue Apr 19, 2016 6:14 am
by rdonnay
I can confirm that there is an error but I have not yet figured out what it is.

There is nothing wrong with the sample program. It has not changed since I originally wrote it back in 2004.

The error is occurring in the Xbase++ Xbpbrowse class.
It will take me awhile to debug this because it appears that there isn't any wrong with the eXpress++ code but I am not sure.

I know that there are a lot of eXpress++ programmers who use SQLexpress and that they have not reported any problems.

I will try to figure this out today.

Re: SQLBROW: error Called from MAIN(69)

Posted: Tue Apr 19, 2016 6:36 am
by rdonnay
Ok, I found the answer to the problem.

When I originally wrote that sample program it was tested under Xbase++ 1.82.

Alaska made a lot of changes to XbpBrowse and XbpColumn in 1.9.

Apparently, I never tested that sample program under 1.9.

DCBROWSECOL commands should always have a WIDTH parameter.

Change SQLBROW.PRG as follows:

Code: Select all

FOR i := 1 TO oCursor:fCount
  DCBROWSECOL DATA SQLFieldBlock( oCursor, i ) ;
      HEADER oCursor:fieldName(i) ;
      SORT SQLSortBlock( oCursor, i ) ;
       _DEFAULT oCursor:fieldName(i) == 'AGENTID' ;
      WIDTH 10 ;  <<<<<<<<<<<<<<<<<<<< add this
      PARENT oBrowse
NEXT