TDataSource TDBMemo issues with values coming back
as a follow up question to my previous one. I can edit the DBMemo's now.
However they always seem to have the values from the very first row in the table. I've done a开发者_JAVA百科 DBMemo1.Text = '' I've done a locate on the DataSet underneath to see if it would clear it. but no.
What do I need to do to have that empty and type something in to insert it?
Like any other data-aware control, the memo is bound to the values from the current row in the table. Try putting a TDBNavigator and a TDBGrid on your form so you can play around with the current record and see what's going on. If you want to create an empty row to insert into it, you need to call Insert
or Append
on the dataset, or click the + symbol on the TDBNavigator. This creates a new, blank row in the dataset and sets it to the current row.
You probably need to add a new row to the dataset.
DataSet.Append;
I saw your last question and I believe the following tutorial will help you:
http://delphi.about.com/od/database/a/databasecourse_2.htm
To clear the text from DBMemo you should either Insert, Append or Delete+Insert/Append on your data set. Mason explained you very well that you need to have a 'navigator' for your data set. Follow the examples provided here:
http://delphi.about.com/od/database/ss/dbcourse_browse.htm
Best regards,
Radu
精彩评论