TZReadOnlyQuery to TClientDataSet
Posted: 17.01.2006, 14:09
Hello
I’m using a TZReadOnlyQuery to get my data for the DB. but I would like to use a standard VCL TClientDataSet to parse down to my objects. So if the Zeos components change, I’ll only have to change the dbConnection module.
But the problem, what is the best way to transfer/copy the data from the TZReadOnlyQuery to the TClientDataSet?
I tried this way:
for i:=0 to ZReadOnlyQuery1.Fields.Count-1 do
ClientDataSet1.Fields.Add(ZReadOnlyQuery1.Fields.Fields);
But that only copyed the pointes, not the data, sow on a free the program will crash. :s
Any ideas?
.:martin
I’m using a TZReadOnlyQuery to get my data for the DB. but I would like to use a standard VCL TClientDataSet to parse down to my objects. So if the Zeos components change, I’ll only have to change the dbConnection module.
But the problem, what is the best way to transfer/copy the data from the TZReadOnlyQuery to the TClientDataSet?
I tried this way:
for i:=0 to ZReadOnlyQuery1.Fields.Count-1 do
ClientDataSet1.Fields.Add(ZReadOnlyQuery1.Fields.Fields);
But that only copyed the pointes, not the data, sow on a free the program will crash. :s
Any ideas?
.:martin