Problems with DBSeek()

Problems with DBSeek()

Postby jose_murugosa » Tue Apr 03, 2007 6:47 pm

If you look for the word dbseek in the forum you will see many recent messages refering to errors in searches.

Them all have in common the use of DBSEEK, of course, and many of them were resolved with searches of fwh objects or just not resolved.

What I really believe is that this function doesnt work properly, and It was working properly in March 2006.

In this sample you can see a very simple search, you will see if you write "DISKETTE" in both searches that the one builded with FWH March 2006 work properly and the builded with FWH 7.01 does´nt work (6.12 is the same), source code is attached too.

http://www.mediafire.com/?1junmnokzil

Please confirm me If I´m wright or wrong, and In both cases what can I do.
_________________
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay

Postby Antonio Linares » Tue Apr 03, 2007 11:26 pm

Jose,

DbSkeek() its not a FWH function, but a Harbour/xHarbour one.

If there is a problem with DbSkeek() then we may check what Harbour/xHarbour build you are using and try to reproduce a possible bug in text mode (without FWH) and report it to the Harbour/xHarbour developers mailing list.

Please lets build a small sample that proves the existence or not of a DbSeek() bug. Also it is very important to rebuild the indexes as they could be corrupted.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Wed Apr 04, 2007 4:07 pm

Jose,

Here is the problem; the last character typed into the get is getting added to the search string twice so you see:

DD
DII
DISS
DISKK
etc.

Here is how you can test it. Add a msgInfo() as shown:

Code: Select all  Expand view
STATIC FUNCTION Busqueda( oGetBusca, cKey, oDlg, oLbx, XNOMEC )
//ogetbusca el objeto get, xnomec la variable del get


    LOCAL RetornaBusca := ""

    MEMVAR oNome_Busca

    BusquedaInterna( oGetBusca, cKey, oDlg, @RetornaBusca, oLbx )

    msgInfo( retornaBusca ) // Add this line

    IF lOpcaoRadio=1  //-> Busqueda de opcion uno en Radio Button
        PRODUCTO->( DBSEEK( ALLTRIM( RetornaBusca), .t. ) )
    ELSE              //-> Busqueda de Opcion 2 do Radio Button
        PRODUCTO->( ORDWILDSEEK( "*" + ALLTRIM( RetornaBusca ) + "*", .F. ) )
    ENDIF

    oLbx:Refresh()

RETURN( .T. )


There were changes to the way oGet:bChange is processed which probably explains what is happening. Users were complaining that bChange didn't contain the last character typed so TGet was modified so that it did. And you are adding the last character, thus you now have the last character twice.

I suggest using oGet:bPostKey instead of oGet:bChange. bPostKey will contain the last character typed, and I have made a recommendation to Antonio to switch bChange back to its original processing as it is needed to reject invalid characters. Thus if you modify your code to work with bChange now, it will be broken again when Antonio changes the code back to its original form. You can search the forum for this discussion which was about two to three weeks ago.

I hope I have explained this well.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby jose_murugosa » Wed Apr 04, 2007 6:15 pm

James,

As always you are wright, just a few hours before I recieve a sugestion in the same direction.

You are completely clear, that is the problem, I proved with my tget class of March 2006 and it works ok.

Thanks for your help and support, I will prove with 7.01 class using oGet:bPostKey code block.

Thanks!!!!!!!
Saludos/Regards,
José Murugosa
"Los errores en programación, siempre están entre la silla y el teclado y la IA!!"
User avatar
jose_murugosa
 
Posts: 1180
Joined: Mon Feb 06, 2006 4:28 pm
Location: Uruguay


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 77 guests