Página 1 de 1

TMemDataSet:Clone() not working in Xailer 8

Publicado: Sab Jun 04, 2022 3:44 pm
por ftwein
Hi,

In Xailer 7.2 it's ok.

Could you please check?

Regards,

Fausto Di Creddo Trautwein

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Sab Jun 04, 2022 7:35 pm
por ignacio
Hi,

We will take a look. BTW, if a RTE is generated, the error.log is highly appreciated.

Regards,

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Sab Jun 04, 2022 7:51 pm
por ftwein
Unfortunately there is no RTE.

Thanks,

Fausto

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Lun Jun 06, 2022 7:01 pm
por ignacio
Unfortunately I can´t see the error. Please be MORE SPECIFIC.

My test with sample \datacontrols\MemDataset2

Código: Seleccionar todo

METHOD RSCreate( oSender ) CLASS TForm1

   LOCAL aData, aHeaders
   LOCAL oClone

   aData := ::oSQLiteDataSource1:QueryArray( "SELECT * FROM CUSTOMER", @aHeaders )

   oSender:Open( aData, aHeaders )

   oClone := ::oRS:Clone()

   WITH OBJECT oClone
      :Gotop()
      DO WHILE !:Eof()
         LogDebug( :First )
         :Skip()
      ENDDO
      :End()
   END WITH
RETURN Nil
Everything worked as expected.

Regards,

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Lun Jun 06, 2022 8:37 pm
por ftwein
Please run the project attached in the first post.

Fausto

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Mar Jun 07, 2022 9:04 am
por ignacio
Hi,

Done! Everything worked as expected.

Regards.

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Mar Jun 07, 2022 1:44 pm
por ftwein
Hi,

Until version 7.2 when a record was added to the cloned TMemDataSet it was reflected to the original TMemDataSet, in version 8 this does not happen.

So, in the code bellow, in version 7.2 oDSClone:RecCount() is equal to ::oMemDataSet1:RecCount(). And in version 8 they are not, ::oMemDataSet1:RecCount() remains 0.

Código: Seleccionar todo

METHOD Button1Click( oSender ) CLASS TForm1
LOCAL oDSClone

oDSClone:= ::oMemDataSet1:Clone()

oDSClone:AddNew()
oDSClone:id:= 1
oDSClone:Update()

::oMemDataSet1:Refresh()

::oEdit1:Value:= ::oMemDataSet1:RecCount()
::oEdit2:Value:= oDSClone:RecCount()

RETURN Nil
Thanks for your time,

Fausto

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Mar Jun 07, 2022 5:20 pm
por ignacio
Hi,

Not in my tests. As you can see in the code only when a TRUE parameter is passed to Clone() method the data is also cloned.

Código: Seleccionar todo

METHOD Clone( lFull ) CLASS XMemRecords

	LOCAL oDataSet, oField

   DEFAULT lFull TO .f.

	WITH OBJECT oDataSet := TMemDataSet():Create()

		FOR EACH oField IN ::oDataset:aFields
			WITH OBJECT :AddField( oField:cName )
				:cDisplayName := oField:cDisplayName
				:cDbfName     := oField:cDbfName
				:cType        := oField:cType
				:nLen         := oField:nLen
				:nDec			  := oField:nDec
            :lAllowsNull  := oField:lAllowsNull
            :lEditable    := oField:lEditable
            :DefValue     := oField:DefValue
            :lAutoInc     := oField:lAutoInc
            :lPrimaryKey  := oField:lPrimaryKey
            :cTable       := oField:cTable
            :cFullname    := oField:cFullname
			END WITH
		NEXT

		FOR EACH oField IN ::oDataset:aUserFields
			:AddCalcField( oField:cName, oField:bGetValue )
		NEXT

      :cProcess          := ::oDataset:cProcess
      :lDisplayErrors    := ::oDataset:lDisplayErrors
      :lReadOnly         := ::oDataset:lReadOnly
      :lUpdLinked        := ::oDataset:lUpdLinked
      :oRecords:cFiltExp := ::cFiltExp
      :oRecords:SortExp  := ::SortExp

      IF ::oDataset:lOpen
         :Open( iif( !lFull, ::aData, aClone( ::aData ) ) )
         :Goto( ::Recno )
		ENDIF

	END WITH

RETURN oDataset
Imagen 157.png
Imagen 157.png (3.03 KiB) Visto 1832 veces

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Mar Jun 07, 2022 7:40 pm
por ftwein
Hi,

I've tested by installing Xailer 8 in a new folder and it's still not working.

What else can I try to resolve this issue?

Maybe someone else can try it and post the result. Somebody ?

Thanks,

Fausto

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Mié Jun 08, 2022 8:41 pm
por ftwein
Dear friends,

I installed Xailer 8 on another computer, one that never had Xailer installed, and no luck. The same problem persists.

Downloaded Xailer 8 from https://download.xailer.com/?en&file=1
and harbour from https://download.xailer.com/?en&file=2

I will be grateful if you continue to investigate this case.

Fausto

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Jue Jun 09, 2022 4:48 pm
por ignacio
Hi,

Complete project attached. Included EXE file.

https://ozs0-my.sharepoint.com/:u:/g/pe ... g?e=xZnKMJ

I really do not know where is the problem

Regards,

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Jue Jun 09, 2022 11:10 pm
por ftwein
Hi,

Thank you for the files.

I think maybe the version available for download may have some difference from yours.

I'm saying this because I downloaded and installed it on another computer and it gave me the wrong result.

In my tests if I added

Código: Seleccionar todo

/*MemRecords.prg*/
METHOD My_Refresh() CLASS XMemRecords
   ::RecCount := Len( ::aWork )
   ::Bof      := .F.
   ::Eof      := ( ::RecCount == 0 )
RETURN Nil
and changeg

Código: Seleccionar todo

/*Form1.prg*/
METHOD Button1Click( oSender ) CLASS TForm1
LOCAL oDSClone

oDSClone:= ::oMemDataSet1:Clone()

oDSClone:AddNew()
oDSClone:id:= 1
oDSClone:Update()

::oMemDataSet1:oRecords:My_Refresh()

::oEdit1:Value:= ::oMemDataSet1:RecCount()
::oEdit2:Value:= oDSClone:RecCount()

RETURN Nil
This way it works, because ::aData and ::aWork were being updated, but not ::RecCount.

I would really like to switch to version 8, with all the improvements it has, but this issue is holding me back.

Thank you again and I hope you can come up with an idea.

Fausto.

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Vie Jun 10, 2022 8:52 am
por ignacio
Hello,

Xailer 8.01 will be published shortly. Please wait until then. TIA.

Regards,

Re: TMemDataSet:Clone() not working in Xailer 8

Publicado: Mié Jun 15, 2022 7:52 pm
por ftwein
Hi,

It's ok with Xailer 8.0.1.

Thank you very much.

Regards,

Fausto