Solve the problem of Delphi's DBGrid in reading the Access text Type field display Twidememofield

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.