FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Problem in AdoIncrSeek( ) of xHarbour
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Problem in AdoIncrSeek( ) of xHarbour
Posted: Tue Aug 05, 2014 12:36 PM

Hello

I have a xBrowse with a ADO table , if I press the key ' ( example I seek TEST' )

The problem is in ::oRs:Find( cExpr, 0, 1, 1 )
where cExpr --> DESCRI LIKE 'TEST'*'

Regards Maurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Tue Aug 05, 2014 12:51 PM
Please locate these lines:
Code (fw): Select all Collapse
      do case
      case cType == 'C'

         if ::lSeekWild

Please insert one line above if ::lSeekWild
Code (fw): Select all Collapse
      do case
      case cType == 'C'
         uSeek := StrTran( uSeek, "'", "''" ) // inserted
         if ::lSeekWild

Note: Replace single "single quote" with "two single quotes".
Let us see if this works.
Normally we avoid quotes. etc in seeks and filters.
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Tue Aug 05, 2014 01:54 PM

Thanks ,

it works perfectly :)

Maurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Tue Aug 05, 2014 02:16 PM
Maurizio wrote:Thanks ,

it works perfectly :-)

Maurizio

Thanks for your testing.
We shall include that.
But again we can not seek double quotes :-)
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Tue Aug 05, 2014 04:36 PM

Hello Rao

another question .
I have a xBrowse with a ADO Table , I need to make a new SELECT in the same browse .
Is it possible without closing and reopening the browse ?

Ghirardini Maurizio

www.nipeservice.com

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Tue Aug 05, 2014 05:11 PM

Yes, thats what we intended to provide. At the same time let me confess that I did not do much testing. You can help to test and see how it works.

First assuming that the columns (fields) are identical, replace oBrw:oRs with new recordset.

oNewRs := <open a new recordset with revised SELECT statement>

oSaveRs :- oBrw:oRs
oBrw:oRs := oNewRs
oBrw:GoTop()
oBrw:Refresh()
oSaveRs:Close()
oSaveRs := nil

Please see if this works without any problems.

Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Wed Aug 06, 2014 06:44 AM

Thanks Rao

your example works .

This works to
oBrw:oRs := oRsNew
oBrw:GoTop()
oBrw:Refresh()

Regards MAurizio

www.nipeservice.com

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Thu Mar 22, 2018 03:05 AM
This may be better
Code (fw): Select all Collapse
   WITH OBJECT oBrw
      :lScreenUpdating := .f.
      :oRs:Close()
      :oRs:Source := <revised SQL statement>
      :oRs:Open()
      :GoTop()
      :lScreenUpdating := .t.
      :Refresh()
   END
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Problem in AdoIncrSeek( ) of xHarbour
Posted: Thu Mar 22, 2018 04:11 PM

Thanks Rao

Maurizio

www.nipeservice.com

:D

Continue the discussion