Board index » delphi » 'Incompatible types 'string' and 'Tdbedit''

'Incompatible types 'string' and 'Tdbedit''

Hello,
I'm trying to use a dbedit box to insert records into a paradox table
It must also update a label on the form.
When I run the program I get
'Incompatible types  'string' and 'Tdbedit''
When the label's caption is being changed...
Heres the line of code.

Label1.caption:=vininsert;

This is when I get the error

What am I doing wrong?
Thanks
Phil

 

Re:'Incompatible types 'string' and 'Tdbedit''


Quote
Phillip Coomer wrote in message <34cf7499.4187...@news.fastlane.net>...
>Hello,
>I'm trying to use a dbedit box to insert records into a paradox table
>It must also update a label on the form.
>When I run the program I get
>'Incompatible types  'string' and 'Tdbedit''
>When the label's caption is being changed...
>Heres the line of code.

>Label1.caption:=vininsert;

And vininsert is? If it is the TDBEdit, then the line should be
Label1.caption:=vininsert.text;

        -- Kirk

Re:'Incompatible types 'string' and 'Tdbedit''


Label1.caption:=vininsert.text ;

The original statement assigned the entire tdbedit component to the
caption - you only want the text (or editText) property of the tdbedit to be
used in the caption.

Quote
Phillip Coomer wrote in message <34cf7499.4187...@news.fastlane.net>...
>Hello,
>I'm trying to use a dbedit box to insert records into a paradox table
>It must also update a label on the form.
>When I run the program I get
>'Incompatible types  'string' and 'Tdbedit''
> .....

Re:'Incompatible types 'string' and 'Tdbedit''


On Wed, 28 Jan 1998 18:10:46 GMT, Cr...@craftmark.com (Phillip Coomer)
wrote:

Quote
>Hello,
>I'm trying to use a dbedit box to insert records into a paradox table
>It must also update a label on the form.
>When I run the program I get
>'Incompatible types  'string' and 'Tdbedit''
>When the label's caption is being changed...
>Heres the line of code.

>Label1.caption:=vininsert;

>This is when I get the error

>What am I doing wrong?
>Thanks
>Phil

Try Label1.caption := vininsert.text;

Other Threads