Como se Clona un Objeto

Post Reply
User avatar
ruben Dario
Posts: 986
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Como se Clona un Objeto

Post by ruben Dario »

Saludos al forum

Como se clona un Objeto.
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como se Clona un Objeto

Post by karinha »

oNew := oClone( oObject )

Salu2
João Santos - São Paulo - Brasil
User avatar
ruben Dario
Posts: 986
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Como se Clona un Objeto

Post by ruben Dario »

Gracias karinha

Me da este error al ejecutar

__objcole -- Error de Argumento
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como se Clona un Objeto

Post by karinha »

Que intentas clonar, una ListBox?
João Santos - São Paulo - Brasil
User avatar
ruben Dario
Posts: 986
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Como se Clona un Objeto

Post by ruben Dario »

No
No se si es posible clonar esto
oQSet := TOleAuto():New( "ADODB.Recordset" )
...
oQSet:Open( "Select "+ cSelect +" from " + cTabla + " LIMIT 50" , oApp:StrConnection,1, 3 )

Intento clonar el oQSet no se si es posible,
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como se Clona un Objeto

Post by karinha »

ni jo.
mis desculpas.

salu2
João Santos - São Paulo - Brasil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Como se Clona un Objeto

Post by Antonio Linares »

Ruben,

Clonar un objeto que use determinados handles de Windows, memoria, buffers, etc., no tiene sentido. El resultado no serviría de nada, ó provocaría muchos errores.

Lo que puedes hacer es copiar los valores de las datas del objeto, pero el objeto en si, completo, no podria ser duplicado y uno provocaria errores en el otro.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Como se Clona un Objeto

Post by nageswaragunupudi »

ruben Dario wrote:No
No se si es posible clonar esto
oQSet := TOleAuto():New( "ADODB.Recordset" )
...
oQSet:Open( "Select "+ cSelect +" from " + cTabla + " LIMIT 50" , oApp:StrConnection,1, 3 )

Intento clonar el oQSet no se si es posible,
RecordSet has a Clone method in ADO.

oRs2 := oRs:Clone()

oRs2 has all the filter, sort, record position at the time of cloning.
For all subsequent operations, the two recordsets are in independent.
Regards

G. N. Rao.
Hyderabad, India
User avatar
ruben Dario
Posts: 986
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Como se Clona un Objeto

Post by ruben Dario »

Muchas Gracias

Por su aporte y alcaracion
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
MOISES
Posts: 824
Joined: Wed Aug 22, 2007 10:09 am

Re: Como se Clona un Objeto

Post by MOISES »

No, it is not.

When you clone a Recordset you actually just create a new pointer to the same Recordset, therefore any changes you make to one Recordset will be visible in all of its clones. However, if you execute a Requery on the original Recordset, the clones will no longer be synchronized to the original.

The provider must support bookmarks on the Recordset object to create clones. Bookmarks are interchangeable; a bookmark reference from one Recordset object refers to the same record in any of its clones.

Note: The filter of the original Recordset will not be applied to the clone. To copy an existing filter: objRecordsetNew.Filter=objRecordsetOriginal.Filter
Saludos / Regards,

FWH 20.04, Harbour 3.2.0 dev (r1909261630) y BCC 7.40
Post Reply