xBrowse and SQLRDD bug

Re: xBrowse and SQLRDD bug

Postby MOISES » Tue Jun 09, 2020 6:46 am

Up
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Postby nageswaragunupudi » Thu Jun 11, 2020 5:33 pm

I have tested with this sample with FWH20.04. I found the scrollbar working properly and if we execute DBGOBOTTOM() before invoking the browse, the vertical scrollbar is positioned at the bottom.

Please try this sample on your server, by changing the password, etc.

This is my modified buildx.bat
Code: Select all  Expand view  RUN
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for xHarbour 20.04 - Apr. 2020          Harbour development power  ³Ü
ECHO ³ (c) FiveTech 1993-2020 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

if "%FWDIR%" == "" set FWDIR=.\..\
if "%XHDIR%" == "" set XHDIR=c:\xharbour
rem if "%2" == "/b" set GT=gtwin
rem if not "%2" == "/b" set GT=gtgui
set GT=gtgui

set hdir=%XHDIR%
set hdirl=%hdir%\lib
set bcdir=c:\bcc7
set fwh=%FWDIR%

%hdir%\bin\harbour %1 /n /i%fwh%\include;%hdir%\include;c:\sqlrdd\include /w /p %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERRORS
@type comp.log
@type warnings.log

echo -O2 -e%1.exe -I%hdir%\include -I%bcdir%\include %1.c > b32.bc
%bcdir%\bin\bcc32 -M -c -v @b32.bc
:ENDCOMPILE

IF EXIST %1.rc %bcdir%\bin\brc32.exe -r -I%bcdir%\include -I%bcdir%\include\windows\sdk %1

echo %bcdir%\lib\c0w32.obj + > b32.bc
echo %1.obj, + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo %fwh%\lib\Fivehx.lib %fwh%\lib\FiveHC.lib %fwh%\lib\libmysql.lib + >> b32.bc
echo c:\sqlrdd\lib\odbccp32.lib + >> b32.bc
echo c:\sqlrdd\lib\sql.lib + >> b32.bc
echo %hdirl%\hbhpdf.lib + >> b32.bc
echo %hdirl%\libharu.lib + >> b32.bc
echo %hdirl%\png.lib + >> b32.bc
echo %hdirl%\rtl.lib + >> b32.bc
echo %hdirl%\vm.lib + >> b32.bc
echo %hdirl%\%GT%.lib + >> b32.bc
echo %hdirl%\lang.lib + >> b32.bc
echo %hdirl%\macro.lib + >> b32.bc
echo %hdirl%\rdd.lib + >> b32.bc
echo %hdirl%\dbfntx.lib + >> b32.bc
echo %hdirl%\dbfcdx.lib + >> b32.bc
echo %hdirl%\dbffpt.lib + >> b32.bc
echo %hdirl%\hbsix.lib + >> b32.bc
echo %hdirl%\debug.lib + >> b32.bc
echo %hdirl%\common.lib + >> b32.bc
echo %hdirl%\codepage.lib + >> b32.bc
echo %hdirl%\pp.lib + >> b32.bc
echo %hdirl%\pcrepos.lib + >> b32.bc
echo %hdirl%\ct.lib + >> b32.bc
echo %hdirl%\zlib.lib + >> b32.bc
echo %hdirl%\hbzip.lib + >> b32.bc
echo %hdirl%\libmisc.lib + >> b32.bc
echo %hdirl%\tip.lib + >> b32.bc
echo %hdirl%\hbzebra.lib + >> b32.bc
rem echo %hdirl%\png.lib + >> b32.bc

rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib + >> b32.bc
rem echo %hdir%\lib\Ace32.lib + >> b32.bc

echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\uuid.lib + >> b32.bc
echo %bcdir%\lib\ws2_32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\psapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\gdiplus.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\shell32.lib, >> b32.bc

IF EXIST %1.res echo %1.res >> b32.bc

rem uncomment this line to use the debugger and comment the following one
if %GT% == gtwin %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
if %GT% == gtgui %bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c

:COMPILEERRORS
@type comp.log
ECHO * Compile errors *
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi?n PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT


This is my sample program:
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "SQLRDD.Ch"
#include "MySQL.Ch"

REQUEST DBFCDX
REQUEST SQLRDD, SR_MYSQL

function Main()

   local cServer, cDatabase, cUser, cPassword, cConnection, nConnection := 0
   local aData, aStruct

   cServer     := "localhost"
   cDatabase   := "sqlrdd"
   cUser       := "root"
   cPassword   := "??????"

   ? "Start"

   USE STATES SHARED
   aData    := FW_DbfToArray()
   aStruct  := DBSTRUCT()
   CLOSE DATA

   cConnection := "HST="+cServer+";UID="+cUser+";PWD="+cPassword+";DTB="+cDatabase
   MsgRun( "Connecting to Server", "SQLRDD", ;
           { || nConnection := SR_AddConnection( CONNECT_MYSQL, cConnection ) } )
   ? "nConnection =", nConnection

   if nConnection <= 0
      MsgAlert("No conexion. ","Verifique!")
      QUIT
   endif

   RddSetDefault("SQLRDD")
   SR_UseDeleteds(.F.)

   MsgRun( "Creting states table", "SQLRDD", ;
           { || DBCREATE( "states", aStruct, "SQLRDD" ) } )

   MsgRun( "Writing 51 records to states.dbf", "SQLRDD", <||
      USE states EXCLUSIVE NEW VIA "SQLRDD"
      FW_ArrayToDBF( aData )
      CLOSE DATA
      return nil
      > )

   MsgRun( "Using sates.dbf", "SQLRDD", <||
      USE states SHARED NEW VIA "SQLRDD"
      GO BOTTOM
      > )

   XBROWSER "STATES" FASTEDIT SHOW RECID TITLE FWVERSION + " " + RDDNAME()

   DBCLOSEALL()

   SR_end()

   ? "Done"

return nil

//-------------------------------------------------------------------------------------------------------------
 


This is the result:
Image

Notes:
VScrollbar works as expected when the dbf is in natural order (not set to an index) and no filter is set.

I am unable to understand why this is not working at your end.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: xBrowse and SQLRDD bug

Postby MOISES » Thu Jun 11, 2020 7:26 pm

First of all, thank you for your time.

It fails when the DBF has an index.

Please add this changes:

Code: Select all  Expand view  RUN


USE states SHARED NEW VIA "SQLRDD"
  index on field->CODE TAG NAGES1

  GO BOTTOM

  XBROWSER "STATES" FASTEDIT SHOW RECID TITLE FWVERSION + " " + RDDNAME()

  DBCLOSEALL()

  SR_end()
 


The result is this:

Image
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am

Re: xBrowse and SQLRDD bug

Postby nageswaragunupudi » Sun Jul 05, 2020 8:35 pm

We enhanced VScroll bar compatibility for SQLRDD xbrowse in FWH 2006.

This is the test program:
Code: Select all  Expand view  RUN
#include "FiveWin.ch"
#include "SQLRDD.Ch"
#include "MySQL.Ch"

REQUEST DBFCDX
REQUEST SQLRDD, SR_MYSQL

static SQLRDD_nKeyNo  := 1

function Main()

   field CODE,NAME

   local cServer, cDatabase, cUser, cPassword, cConnection, nConnection := 0
   local aData, aStruct, cTag

   cServer     := "localhost"
   cDatabase   := "sqlrdd"
   cUser       := "root"
   cPassword   := "password"

   ? "Start"

   USE STATES SHARED
   aData    := FW_DbfToArray()
   aStruct  := DBSTRUCT()
   CLOSE DATA

   cConnection := "HST="+cServer+";UID="+cUser+";PWD="+cPassword+";DTB="+cDatabase
   MsgRun( "Connecting to Server", "SQLRDD", ;
           { || nConnection := SR_AddConnection( CONNECT_MYSQL, cConnection ) } )
   ? "nConnection =", nConnection

   if nConnection <= 0
      MsgAlert("No conexion. ","Verifique!")
      QUIT
   endif

   RddSetDefault("SQLRDD")
   SR_UseDeleteds(.F.)

   MsgRun( "Creting states table", "SQLRDD", ;
           { || DBCREATE( "states", aStruct, "SQLRDD" ) } )

   MsgRun( "Writing 51 records to states.dbf", "SQLRDD", <||
      USE states EXCLUSIVE NEW VIA "SQLRDD"
      FW_ArrayToDBF( aData )
      INDEX ON CODE TAG CODE
      INDEX ON UPPER(NAME) TAG NAME ADDITIVE
      CLOSE DATA
      return nil
      > )


   MsgRun( "Using sates.dbf", "SQLRDD", <||
      USE states SHARED NEW VIA "SQLRDD"
      > )

   SET ORDER TO TAG NAME
   GO BOTTOM

   XBROWSER ALIAS() FASTEDIT AUTOSORT SHOW RECID ;
      TITLE FWVERSION + " : SQLRDD" ;
      SETUP ( oBrw:lFastEdit := .f., oBrw:lVThumbTrack := .t. )

   DBCLOSEALL()

   SR_end()

   ? "Done"

return nil

//-------------------------------------------------------------------------------------------------------------
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 39 guests