Page 1 of 1
Problem SQL Browse
Posted: Sun Mar 27, 2011 10:04 am
by c-tec
Hello Roger,
have a big problem with the latest version of eXPress++, when browsing a SQL table, the fields are not displayed in the browser and the whole first row of a table has empty fields after a oCursor:commit(). The same code works for example with version 2.51 without problems. The dataset is ok when I check the content of the fields.
regards
Rudolf
Code: Select all
DCBROWSECOL DATA SQLFieldBlock( oCursor, 'id' ) WIDTH 8 HEADER 'ID' SORT SF_SQLSortBlock( oCursor, 1 ,@nColumn)
DCBROWSECOL DATA SQLFieldBlock( oCursor, 'status' ) WIDTH 8 HEADER 'Auftrag' SORT SF_SQLSortBlock( oCursor, 2 ,@nColumn)
...
DCREAD GUI FIT
oCursor:commit() // in the first row of the table all fields are empty
FUNCTION SQLFieldBlock( oCursor, nField )
******************************************************************
Return {|x| iif(PCount()==0, oCursor:fieldGet(nField), oCursor:fieldPut(nField, x))}
Re: Problem SQL Browse
Posted: Sun Mar 27, 2011 10:25 am
by c-tec
Hello Roger,
also the sql sample does not work in the latest version, same source with 2.51 works.
regards
Rudolf
------------------------------------------------------------------------------
ERROR LOG of "v:\alaska19\EXP19\Samples\Sql\SQLBROW.EXE" Date: 27.03.2011 18:35:28
Xbase++ version : Xbase++ (R) Version 1.90.355
Operating system : Windows Vista 06.01 Build 07600
------------------------------------------------------------------------------
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(320)
Called from XBPBROWSE:INSCOLUMN(868)
Called from XBPBROWSE:ADDCOLUMN(689)
Called from DC_XBPCOLUMN:INIT(2125)
Called from DC_GETLIST:READGUI(2412)
Called from DC_READGUI(101)
Called from MAIN(63)
Re: Problem SQL Browse
Posted: Sun Mar 27, 2011 4:18 pm
by rdonnay
I added code to _DCXBROW.PRG to pass a parameter to the column datalink code block.
This was needed for other reasons, but is not needed when working with SQL objects.
I didn't test it with SQL objects. SORRY!
I could give you a workaround for your code, but I think it is best to fix it in _DCXBROW.PRG.
Make the change (around line 2108) as shown below.
Then rebuild DCLIPX.DLL by running BUILD19_SL1.BAT.
This fix will be in the next build.
Code: Select all
Was:
IF !Empty(::picture)
::dataLink := _ColPicture( bDataBlock, ::picture, self )
ELSEIF !lMultiline
::dataLink := {|x|Eval(bDataBlock,x,self)}
ELSE
::dataLink := bDataBlock
ENDIF
Is:
IF !Empty(::picture)
::dataLink := _ColPicture( bDataBlock, ::picture, self )
ELSEIF !lMultiline .AND. Valtype(::parent:dataSource) # 'O'
::dataLink := {|x|Eval(bDataBlock,x,self)}
ELSE
::dataLink := bDataBlock
ENDIF
Re: Problem SQL Browse
Posted: Sun Mar 27, 2011 11:07 pm
by c-tec
Hello Roger,
many thanks, all works perfect again !
regards
Rudolf
Re: Problem SQL Browse
Posted: Tue May 17, 2011 3:13 am
by Andy Edward
Hi Roger,
I have a Browse where the data is from SQLSelect().
Code: Select all
oCursor = SQLSelect():new("SELECT * FROM A",oConn)
oCursor:Execute()
DCBROWSE oBrowse Data oCursor
DCBROWSECOL SQL_FieldBlock(oCursor, 'Field1')
Now I want to filter that data using a where clause
So I change the oCursor attribute.
Code: Select all
oCursor:SQLString = "SELECT * FROM A WHERE FIELD1 = 'N'"
oCursor:Execute()
oCursor:GoTop()
**Say I get 10 records out of 100. Then I refresh the browse
I was expecting to see the Browse list 10 records with different details, but instead the browse list out 10 records of the FIRST record
So Actual result after using the where clause:
N field1
N field1
N field1
N field1
N field1
N field1
N field1
N field1
N field1
N field1
Expected Result is:
N field1
N field2
N field3
N field4
N field5
N field6
N field7
N field8
N field9
N field10
Can you kindly advise me on this? Is there something I'm doing wrong?
Best Regards,
Andy Edward Gunawan
Re: Problem SQL Browse
Posted: Tue May 17, 2011 4:13 pm
by rdonnay
I don't understand what you are saying.
Have you tried your SQL SELECT statement using another utility program?