 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Jacques Zoo Guest
|
Posted: Sat May 08, 2004 6:30 pm Post subject: EVariantTypeCastError When Using SQL Server |
|
|
I created a table in MS SQL Server to use in a C++ Builder database. I used the ADOTable and its ConnectionString to connect to the database. When I run the form that hosts the controls, I receive an "...EVariantTypeCastError With Message 'Could Not Convert Variant Of Type (Null) Into Type (String)'..." After I click OK, everything is fine, the form works fine. Since I find this message annoying, I was just wondering if somebody knows how I can fix/treat it.
Thanks.
|
|
| Back to top |
|
 |
James Peterson Guest
|
Posted: Mon May 10, 2004 12:54 pm Post subject: Re: EVariantTypeCastError When Using SQL Server |
|
|
I was having problems with this also till I changed my primary key from a
char to a varchar. And for some reason that fixed my problem.
"Jacques Zoo" <jezoo (AT) yahoo (DOT) com> wrote
| Quote: |
I created a table in MS SQL Server to use in a C++ Builder database. I
used the ADOTable and its ConnectionString to connect to the database. When |
I run the form that hosts the controls, I receive an
"...EVariantTypeCastError With Message 'Could Not Convert Variant Of Type
(Null) Into Type (String)'..." After I click OK, everything is fine, the
form works fine. Since I find this message annoying, I was just wondering if
somebody knows how I can fix/treat it.
|
|
| Back to top |
|
 |
Jacques Zoo Guest
|
Posted: Tue May 11, 2004 12:11 pm Post subject: Re: EVariantTypeCastError When Using SQL Server |
|
|
Since I don't like to let users play with the primary key, I always create it as int with Identity that autoincrements. Instead of changing the data type on the primary key, is there another solution?
"James Peterson" <jpeterson (AT) romanmealmilling (DOT) com> wrote:
| Quote: | I was having problems with this also till I changed my primary key from a
char to a varchar. And for some reason that fixed my problem.
"Jacques Zoo" <jezoo (AT) yahoo (DOT) com> wrote in message
news:409d274d$1 (AT) newsgroups (DOT) borland.com...
I created a table in MS SQL Server to use in a C++ Builder database. I
used the ADOTable and its ConnectionString to connect to the database. When
I run the form that hosts the controls, I receive an
"...EVariantTypeCastError With Message 'Could Not Convert Variant Of Type
(Null) Into Type (String)'..." After I click OK, everything is fine, the
form works fine. Since I find this message annoying, I was just wondering if
somebody knows how I can fix/treat it.
Thanks.
|
|
|
| Back to top |
|
 |
Vladimir Stefanovic Guest
|
Posted: Sat May 22, 2004 5:38 pm Post subject: Re: EVariantTypeCastError When Using SQL Server |
|
|
| Quote: | When I run the form that hosts the controls, I receive an
"...EVariantTypeCastError With Message 'Could Not Convert
Variant Of Type (Null) Into Type (String)'..."
|
This is how I solved this in classic DB (ADO) programming...
Double (left) click on the Table object in DataModule (if you
stated it there) and than right click and "Add all fields"...
Rebuild All...
Vladimir Stefanovic
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|