Requery nativa Mr.Rao.

Post Reply
Ariel
Posts: 379
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Requery nativa Mr.Rao.

Post by Ariel »

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

Saludos.
User avatar
Rick Lipkin
Posts: 2677
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA
Been thanked: 2 times

Re: Requery nativa Mr.Rao.

Post by Rick Lipkin »

Ariel

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

Code: Select all | Expand


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
Ariel
Posts: 379
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Requery nativa Mr.Rao.

Post by Ariel »

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 ???
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Been thanked: 11 times
Contact:

Re: Requery nativa Mr.Rao.

Post by nageswaragunupudi »

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

#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
Ariel
Posts: 379
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Requery nativa Mr.Rao.

Post by Ariel »

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: 379
Joined: Wed Nov 29, 2006 1:51 pm
Location: Rosario - Argentina

Re: Requery nativa Mr.Rao. (SOLUCIONADO)

Post by Ariel »

Mr. Rao,

gracias funciona perfectamente.

Saludos.
Post Reply