![]() |
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; |
La franja horaria es GMT +2. Ahora son las 21:57:42. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi