Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 17-07-2006
Noname Noname is offline
Registrado
 
Registrado: jul 2006
Posts: 1
Poder: 0
Noname Va por buen camino
Añadiendo datasets

Tengo un problemilla:

Tengo un xml con el q mediante un xmlprovider, un clientdataset y un datasource hago unas maravillosas tablas

PERO

Me gustaria aumentar dinamicamente el tamaño de la tabla (q luego guardaria facilmente en el xml)

La tabla tiene esta estructura:

nombre (string) (seria el field[0])
control (dataset) (el 1)

y delphi me crea una tabla a partir del dataset de control

Entonces mi problema es q no soi capaz de añadir el dataset del field[1]:

Por favor, me voi a volver loco

Var
cds:TClientDataSet ;
fd : TFieldDef;
dsField: TDataSetField;
i:integer ;
begin

cds := TClientDataSet.Create(nil);

fd := cds.FieldDefs.addfielddef;
fd.Name := 'Size';
fd.DataType := ftInteger;
fd.Required := true;

fd := cds.FieldDefs.addfielddef;
fd.Name := 'Nombre';
fd.DataType := ftString;
fd.Size := 50;
fd.Required := true;

fd := cds.fielddefs.addfielddef;
fd.Name := 'Caption';
fd.DataType := ftString;
fd.Size := 50;
fd.Required := true;

fd := cds.fielddefs.addfielddef;
fd.Name := 'Old Caption';
fd.DataType := ftString;
fd.Size := 50;
fd.Required := false;

cds.CreateDataSet;
cds.IndexDefs.Update;
dsField := cds.DataSetField;
cds.open;

for i := 0 to (FindGlobalComponent(strFrmPadre).ComponentCount-1) do

CtrlConCaption(FindGlobalComponent(strFrmPadre).Components[i],cds);

****************************************
**este metodo hace esto:
Active:=true;
Insert;
Fields[0].asInteger := length(AstrCaption);
Fields[1].AsString := AstrName ;
Fields[2].AsString := AstrCaption ;
Fields[3].AsString := AstrOriginalCaption ;
post;
Active:=false;
**************con el clientdataset q le pasan (cds)

dsField := TDataSetField.Create(nil);
dsField.FieldName := 'Control';

dsField.DataSet := cds;
cdsXML.Active:=true;
cdsXML.append;
cdsXML.Fields[0].asString := strFrmPadre;
//Aqui me dice q no puede hacer esto con un dset abierto
cdsXML.Fields[1] := dsField;
cdsXML.Post;
cdsXml.Active:=false;
cds.close;
Show;
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Datasets en Fastreports 3.20 XaRz Impresión 0 27-01-2006 10:59:16
Añadiendo componentes a Delphi 8 PMUNOZ Gráficos 1 03-05-2005 10:41:28
Añadiendo ShorCuts Dayvis Varios 2 20-11-2004 21:23:09
Problemas con Dbase añadiendo campos en ejecucion yair Tablas planas 5 18-08-2004 22:01:09


La franja horaria es GMT +2. Ahora son las 21:27:00.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi