Original: http://www.makaidong.com/%E5%8D%9A%E5%AE%A2%E5%9B%AD%E7%9F%A5%E8%AF%86%E5%BA%93/22028.shtml
"Resolving Delphi's DBGrid in Reading Access text-type fields shows Twidememofield issues":
Key Words:Solve Delphi DBGrid Read access text field display Twidememofield problem
Title: Delphi's DBGrid in the Read access text field displays Twidememofield.
This problem is caused by the data type, Delphi's built-in mechanism to deal with, so there are three ways to solve the problem
1, for a control that can read the text field, this article is not considered.
2, online There is a method is said to modify the SetText event, to the grid re-assigned value, simple test after no fruit, I am really a half bottle of Delphi vinegar: sloshing.
3, I test the effective method is to modify the adoquery.
Double-click the Adoquery control, pop up the field action form, and add a new custom field such as Memo2. (The original Memo field is assumed to be memo in this article).
Procedure Tsendlist.adoquery2calcfields (Dataset:tdataset); Beginadoquery2.fieldbyname (' sendmsg2 '). asstring:= adoquery2.fieldbyname (' sendmsg '). Asstring;end;
As shown in the code above, the Calcfieds code in Adoquery assigns a value to the newly created field.
In the Cloums attribute of DBGrid, select Show newly added field Memo2.
This will be OK.
In fact, the above solutions in other development environment basic also apply. If your actual requirements are not met in the field list of your data source, add a field to the custom display. Extended, for example,
The bank's data shows the monthly sales from 1 to December, so we can make a 13th field to summarize the data.
Search this article related to: solve the problem of Delphi DBGrid in reading the Access text Type field display Twidememofield
Solve the problem of Delphi's DBGrid in reading the Access text Type field display Twidememofield