DBRichViewEdit with SQL.Text or Varchar Field

General TRichView support forum. Please post your questions here
Post Reply
Aida
Posts: 16
Joined: Mon Sep 04, 2006 6:52 am

DBRichViewEdit with SQL.Text or Varchar Field

Post 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.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The corresponding field object of TTable (TDataSet) must be of TBlobField type
Aida
Posts: 16
Joined: Mon Sep 04, 2006 6:52 am

Post 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...
Aida
Posts: 16
Joined: Mon Sep 04, 2006 6:52 am

Post by Aida »

Would u please answer me 'When I use ADOTable I face the "Invalid class typecast"'.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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 ?
Aida
Posts: 16
Joined: Mon Sep 04, 2006 6:52 am

Post 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.
Aida
Posts: 16
Joined: Mon Sep 04, 2006 6:52 am

Post by Aida »

Would u please answer me.
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Post Reply