Requery nativa Mr.Rao.

Requery nativa Mr.Rao.

Postby Ariel » Sun Apr 25, 2021 5:07 pm

Mr. Rao,
hago un query, y el datarow es ! lreadonly, hago un requery y el que obtengo es lreadonly, por qué?

Saludos.
Ariel
 
Posts: 376
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Requery nativa Mr.Rao.

Postby Rick Lipkin » Mon Apr 26, 2021 12:24 pm

Ariel

It depends on how you setup the recordset ... This is the old fashioned way .. notice openkeyset

Code: Select all  Expand view  RUN

cSQL := "SELECT * from USERINFO order by USERID"

oRsUSER := TOleAuto():New( "ADODB.Recordset" )    
oRsUSER:CursorType     := 1        // opendkeyset
oRsUSER:CursorLocation := 3        // local cache
oRsUSER:LockType       := 3        // lockoportunistic

TRY
   oRsUSER:Open( cSQL,xConnect )
CATCH oErr
   MsgInfo( "Error in Opening USERINFO table" )
   RETURN(.F.)
END TRY

 


Here is a good link
https://wiki.fivetechsoft.com/doku.php? ... ted_stuffs

Rick Lipkin
User avatar
Rick Lipkin
 
Posts: 2666
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Re: Requery nativa Mr.Rao.

Postby Ariel » Mon Apr 26, 2021 3:39 pm

Rick,
gracias por contestar, pero uso fwh nativa directamente. Hago :

oSql:= oCon:Query( "SELECT * FROM articulos" )
? oSql:lreadonly --> .f.

Luego del :Requery() si lo edito :
oRec:= TDataRow():New( ::oSql )
? oRec:lReadonly, oRec:uSource:lReadOnly ---> .t., .t.

por que hace esto ???
Ariel
 
Posts: 376
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Requery nativa Mr.Rao.

Postby nageswaragunupudi » Mon Apr 26, 2021 5:42 pm

There should be no problem with a simple Requery() or Requery( {aparms} ) with params.
The problem is when Requery( cNewQuery ) is used with a totally different Sql query.

Please confirm.

Code: Select all  Expand view  RUN
#include "fivewin.ch"

function Main()

   local oCn, oRs

   oCn   := FW_DemoDB()

   oRs   := oCn:RowSet( "select * from customer" )
   ? oRs:lReadOnly  // --> .f.
   oRs:Requery()
   ? oRs:lReadOnly // --> .f.
   oRs:Requery( "select * from states" ) // Here is the problem. Bug
   ? oRs:lReadOnly  // --> .t.                 // Should be .f. but it is .t.

   oRs:Close()
   oCn:Close()

return nil
 


We are sending you revised libs with the fix.
Regards

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

Re: Requery nativa Mr.Rao.

Postby Ariel » Mon Apr 26, 2021 6:43 pm

Mr. Rao,

exactamente la segunda opción es lo que me sucede, pero el query es el mismo solo que cambia el where, pero el llamado es :requery( cNewQuery )

Saludos.
Ariel
 
Posts: 376
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Requery nativa Mr.Rao. (SOLUCIONADO)

Postby Ariel » Mon Apr 26, 2021 6:49 pm

Mr. Rao,

gracias funciona perfectamente.

Saludos.
Ariel
 
Posts: 376
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina


Return to FiveWin para Harbour/xHarbour

Who is online

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