Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text not showing in TDBGrid

Status
Not open for further replies.

UmaGrama

Technical User
Sep 8, 2003
33
BR
Hi all,

I am using the TDBGrid to display and manipulate a database and for some reason the text in the text field that should be displaying there is not appearing. Even when I try to enter manually to the grid, it wont let me. It highlights what is written there "(Memo)" but it wont let me change it. The number fields are no problem, I can read and write to it. Though the text field doesn't do anything, it only displays "(Memo)".

Does anyone have an idea of what's going on?

Thanks guys.
 
following what u said, you have a Field of type Memo, but the graphics and memos are blobs.
The blobs cannot be displayed in a DBGrid directly.

--- LastCyborg ---
 
I am not very familiar with DBs but when I created the DB in Microsoft Access, there were two options for text fields: Memo and Text. I selected Text. Though when I connect my DBGrid to the DB I created, it shows "(Memo)" in my (supposely) text field.

Anyway, how can I display my data there? The text shows perfectly in my DB when I open with M. Access but it doesnt when I access it in my DBGrid. Therefore I know the data IS getting entered there.

What I am doing is:

Table1->Append();
Table1->FieldByName("Text")->AsString = StringCollected;
Table1->Post();

Got any ideas?
 
Did you connect the Table to a DataSource Component?
I think that you have not connected the components correctly.



--- LastCyborg ---
 
I think it is connected correctly. Would it be correctly if the other fields are working correctly? I mean, I have 4 other number fields and they work perfectly. Only the text field is not showing up.

:?
 
Oooooookkkk...

Read this:

I had the idea of putting an Edit Box on the form, once I click on the Text Cell, it copies the data inside the cell and pastes it to the Edit Box. Guess what?!?!? It works! It takes the data that was suppose to show in that cell and writes onto the Edit Box.

Now, the question remains: why the heck it only shows "(Memo)" inside of the cells?????????

 
My question has already been answered.. it is a blob. So if I cannot access directly, how can i do it indirectly?
 
Ok let's do it indirectly,
First,
Set the ButtonStyle of columns property of the DBGrid (which has the blob value) to cbsEllipsis.

Next
Create a new form that will show the blob value, in this case, put a DBMemo (preferently aligned alClient)

Finally
set the events hadler event of the DBGrid
something like this
void __fastcall TFormThatWillShowTHeBlob::DBGirdEditButtonClick (TObject *Sender)
{
FormThatWillShowTHeBlob->Show();
}



--- LastCyborg ---
 
Thanks a lot man... I got it to work directly. Guess what the problem was!??!?! I thought it could take 256b but it goes up to only 128b. I changed the size of the field and it worked!

Thank you for your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top