Hi!
Can anyone help me solve the problem.
I noticed an unusual operation function "DCBROWSE & DATALINK" in conjunction with "SQLExpress oCursor: BrowseFilter". If you double-click on any line in the "DCBROWSE" cursor immediately jumps to the last record in the table.
If the function ":BrowseFilter" is not included, everything works normally.
Using: Xbase 331, Express 252, SQLExpress 3.1.23
Regards, Peter.
DCBROWSE & DATALINK - SQLExpress :BrowseFilter
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: DCBROWSE & DATALINK - SQLExpress :BrowseFilter
Hi Peter,
I have the exact problem and I have posted the question to the SQLEXPRESS forum and here is Boris' reply
http://www.xbwin.com/forum.php?ng=/%2Fn ... ign%3Dplus
it's under Navigating dataset in a browse object after :browsefilter subject.
Best Regards,
Andy Edward Gunawan
I have the exact problem and I have posted the question to the SQLEXPRESS forum and here is Boris' reply
http://www.xbwin.com/forum.php?ng=/%2Fn ... ign%3Dplus
it's under Navigating dataset in a browse object after :browsefilter subject.
Best Regards,
Andy Edward Gunawan
-
- Posts: 8
- Joined: Wed Feb 03, 2010 1:04 am
Re: DCBROWSE & DATALINK - SQLExpress :BrowseFilter
This will be the proper linkAndy Edward wrote:http://www.xbwin.com/forum.php?ng=/%2Fn ... ign%3Dplus
http://news.xbwin.com/newsgroups.php?ar ... cle_id=965
or this using the news.xb2.netdomain name
http://news.xb2.net/newsgroups.php?art_ ... cle_id=965
Regards,
Pablo Botella
Re: DCBROWSE & DATALINK - SQLExpress :BrowseFilter
The below code is from _DCXBROW.PRG.
I don't see anything wrong with it.
I used this in an application where I used SqlExpress.
I don't see anything wrong with it.
I used this in an application where I used SqlExpress.
Code: Select all
ELSEIF aGetListItem[nGETLIST_SUBTYPE] = BROWSE_SQLEXPRESS // SQLExpress browse
::skipBlock := {|n,o| o:dataSource:Skipper(n) }
::goTopBlock := {|o| o:dataSource:goTop() }
::goBottomBlock := {|o| o:dataSource:goBottom() }
::phyPosBlock := {|o| o:dataSource:RecNo() }
// Navigation blocks for VScroll bar
::posBlock := {|o| o:dataSource:RecNo() }
::lastPosBlock := {|o| o:dataSource:RecCount() }
::firstPosBlock := {|| 1 }
The eXpress train is coming - and it has more cars.
-
- Posts: 103
- Joined: Fri Sep 17, 2010 2:58 am
Re: DCBROWSE & DATALINK - SQLExpress :BrowseFilter
Hi,
Yes I've noticed those codes in the _dcxbrow.prg, that is why I see no reason for the dcbrowse to behave 'differently'. Maybe I'm doing this wrong and I would be very grateful if anyone can take a look at my code. I'm nearing my wits end here
The program comprises of a dcbrowse with 3 buttons on top. one for filtering the dataset using (:browsefilter) and two buttons for navigation, just Next and Previous record.
The Main procedure
The View_AC Function:
Also Is this the right way to navigate the dcbrowse object with a filtered dataset as its data source?
Thank you in advance.
Yes I've noticed those codes in the _dcxbrow.prg, that is why I see no reason for the dcbrowse to behave 'differently'. Maybe I'm doing this wrong and I would be very grateful if anyone can take a look at my code. I'm nearing my wits end here

The program comprises of a dcbrowse with 3 buttons on top. one for filtering the dataset using (:browsefilter) and two buttons for navigation, just Next and Previous record.
The Main procedure
Code: Select all
Procedure Main()
cConnectString := 'SERVER=xxx;DATABASE=xxx;Driver=SQL SERVER;UID=xxx;PWD=xxx;MultipleActiveResultSets=true;Pooling=true'
oConnAC := SQLConnection():new()
oConnAC:driverConnect(Nil, cConnectString)
query_str = "SELECT * FROM AC ORDER BY ACNO"
oDataSetAC := SQLDataSet():new(query_str, oConnAC )
number = oDataSetAC:FCount()
DCSTATUSBAR oSTATTOP SPACING 3 ALIGN 1 HEIGHT 42
@0,0 DCTOOLBAR oToolBar HORIZONTAL parent oSTATTOP SIZE 800,42 PIXEL;
TYPE XBPSTATIC_TYPE_TEXT COLOR nil, GRA_CLR_WHITE
DCADDBUTTON PARENT oToolBar ;
BITMAP 'Post.GIF';
COLOR GRA_CLR_BLACK, XBPSYSCLR_TRANSPARENT;
STATIC FOCUSCOLOR NIL,GRA_CLR_RED;
ACTION {|| VIEW_AC('Y', oDataSetAC), DC_GetRefresh(Getlist), oBrowse:goTop(), DC_GetRefresh(Getlist)}
DCADDBUTTON PARENT oToolBar ;
BITMAP 'NEXT.GIF';
ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_OK),;
oDataSetAC:SKIP(1), IIF(oDataSetAC:EOF(),;
oDataSetAC:SKIP(-1),NIL),DC_GetRefresh(Getlist) };
WHEN {|| !(oDataSetAC:EOF()) } TABSTOP
DCADDBUTTON PARENT oToolBar ;
BITMAP 'PREVIOUS.GIF';
ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_OK),;
oDataSetAC:SKIP(-1), IIF(oDataSetAC:BOF(),;
oDataSetAC:SKIP(1),NIL),;
DC_GETREFRESH(GETLIST) };
WHEN {|| !(oDataSetAC:BOF()) } TABSTOP
@ 1,84 DCBROWSE oBrowse DATA oDataSetAC SIZE 70,20 ;
PRESENTATION DC_BrowPres()
FOR i := 1 TO number
DCBROWSECOL DATA SQLFieldBlock( oDataSetAC, i ) ;
HEADER oDataSetAC:fieldName(i) ;
SORT SQLSortBlock( oDataSetAC, i ) ;
_DEFAULT oDataSetAC:fieldName(i) == 'AGENTID' ;
PARENT oBrowse
NEXT
DCGETOPTIONS ;
AUTORESIZE ;
BUTTONALIGN DCGUI_BUTTONALIGN_CENTER
DCREAD GUI ;
FIT ;
OPTIONS GetOptions ;
BUTTONS DCGUI_BUTTON_EXIT ;
TITLE 'Browsing with SQLexpress'
Return
Code: Select all
FUNCTION VIEW_AC(xTYPE, oDataSetGENERIC) && 20050809
IF xTYPE='Y'
oDataSetGENERIC:BrowseFilter := {|aRow,nRow,oData| oData:FieldGet('LVL')='Y' }
ELSE
oDataSetGENERIC:BrowseFilter := NIL
ENDIF
RETURN NIL
Code: Select all
DCADDBUTTON PARENT oToolBar ;
BITMAP 'NEXT.GIF';
ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_OK),;
oDataSetAC:SKIP(1), IIF(oDataSetAC:EOF(),;
oDataSetAC:SKIP(-1),NIL),DC_GetRefresh(Getlist) };
WHEN {|| !(oDataSetAC:EOF()) } TABSTOP
DCADDBUTTON PARENT oToolBar ;
BITMAP 'PREVIOUS.GIF';
ACTION {|| DC_ReadGuiEvent(DCGUI_EXIT_OK),;
oDataSetAC:SKIP(-1), IIF(oDataSetAC:BOF(),;
oDataSetAC:SKIP(1),NIL),;
DC_GETREFRESH(GETLIST) };
WHEN {|| !(oDataSetAC:BOF()) } TABSTOP