Como se Clona un Objeto

Como se Clona un Objeto

Postby ruben Dario » Thu Apr 11, 2013 4:59 pm

Saludos al forum

Como se clona un Objeto.
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
ruben Dario
 
Posts: 1070
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Como se Clona un Objeto

Postby karinha » Thu Apr 11, 2013 5:06 pm

oNew := oClone( oObject )

Salu2
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7852
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como se Clona un Objeto

Postby ruben Dario » Thu Apr 11, 2013 7:50 pm

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
ruben Dario
 
Posts: 1070
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Como se Clona un Objeto

Postby karinha » Thu Apr 11, 2013 8:26 pm

Que intentas clonar, una ListBox?
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7852
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como se Clona un Objeto

Postby ruben Dario » Thu Apr 11, 2013 8:32 pm

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
ruben Dario
 
Posts: 1070
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Como se Clona un Objeto

Postby karinha » Thu Apr 11, 2013 8:45 pm

ni jo.
mis desculpas.

salu2
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7852
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Como se Clona un Objeto

Postby Antonio Linares » Thu Apr 11, 2013 9:22 pm

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
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Como se Clona un Objeto

Postby nageswaragunupudi » Fri Apr 12, 2013 1:20 pm

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
nageswaragunupudi
 
Posts: 10681
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Como se Clona un Objeto

Postby ruben Dario » Fri Apr 12, 2013 3:38 pm

Muchas Gracias

Por su aporte y alcaracion
Ruben Dario Gonzalez
Cali-Colombia
rubendariogd@hotmail.com - rubendariogd@gmail.com
User avatar
ruben Dario
 
Posts: 1070
Joined: Thu Sep 27, 2007 3:47 pm
Location: Colombia

Re: Como se Clona un Objeto

Postby MOISES » Wed Apr 08, 2020 2:40 pm

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
MOISES
 
Posts: 838
Joined: Wed Aug 22, 2007 10:09 am


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 43 guests