Page 1 of 1

DBRichViewEdit with SQL.Text or Varchar Field

Posted: Mon Sep 04, 2006 7:02 am
by Aida
Hi,

I have a problem with DBRichViewEdit when using a SQL text field or varchar 'or any' that is
when I make the table active it shows an error message 'Invalid class typecast'

Thanks in advance.

Posted: Mon Sep 04, 2006 1:05 pm
by Sergey Tkachenko
The corresponding field object of TTable (TDataSet) must be of TBlobField type

Posted: Tue Sep 05, 2006 12:19 pm
by Aida
Thanks a lot for your answer...

I find this problem when I use AdoConnection, while when I use BDE Table it does not appear, Although the type of the field is MySQL.Text ...

Do You have any idea why this happens...

Posted: Wed Sep 06, 2006 10:03 am
by Aida
Would u please answer me 'When I use ADOTable I face the "Invalid class typecast"'.

Posted: Wed Sep 06, 2006 5:10 pm
by Sergey Tkachenko
BLOB field type is required, because TDBRichView needs SaveToStream and LoadFromStream method of the field, so it tries to typecast it to TBlobField.
What's the type of field?
ADOTable1.FieldByName(FieldName).ClassName ?

Posted: Tue Sep 12, 2006 10:51 am
by Aida
I tried the following:
1. change the type of the table to BLOB.
2. Connect the DBRichview with this field.
3. Test the example .
The problem I got is :
when I first connected DBRichview with this blob field , it worked well . BUT after insertion the field type 'ClassName' changed into varbyte...

Would u please tell me how can I Keep it BLOB.

Thanks.

Posted: Tue Sep 19, 2006 7:23 am
by Aida
Would u please answer me.

Posted: Tue Sep 19, 2006 7:32 am
by Sergey Tkachenko
I am sorry, I do not know the answer. I think blob type is not appropriate for the chosen field type, and the table corrects it.
Try to experiment with different field types.