Hi all,
I'm trying to make a copy of an existing record into the same dataset with some entries changed.
1) I copy the contents to a XML-file with the SaveToFile-procedure
2) I append a a new record to the dataset
3) I now populate the dataset with the old data by using the LoadFromFile-procedure
4) I post the new record and set the mode to edit
5) I change some data
No matter what I do, I end up with empty data. The code looks something like this:
DataModuleRules.SQLSelectRulesList.SaveToFile('SQLSelectRulesList.xml', dfXML); //This generates a nice XML-file
DataModuleRules.SQLSelectRulesList.Append;
if FileExists('SQLSelectRulesList.xml') Then
DataModuleRules.SQLSelectRulesList.LoadFromFile('SQLSelectRulesList.xml'); //The file are being read but nothing happens...
DataModuleRules.SQLSelectRulesList.Post;
DataModuleRules.SQLSelectRulesList.Edit;
DataModuleRules.SQLSelectRulesList.FieldByName('name').AsString:='Copy from - '+ DataModuleRules.SQLSelectRulesList.FieldByName('name').AsString;
Anyone got an idea what is going wrong?
//Cheers Niclas