BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

EVariantTypeCastError When Using SQL Server

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
Jacques Zoo
Guest





PostPosted: Sat May 08, 2004 6:30 pm    Post subject: EVariantTypeCastError When Using SQL Server Reply with 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.
Thanks.


Back to top
James Peterson
Guest





PostPosted: Mon May 10, 2004 12:54 pm    Post subject: Re: EVariantTypeCastError When Using SQL Server Reply with 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

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.
Quote:
Thanks.





Back to top
Jacques Zoo
Guest





PostPosted: Tue May 11, 2004 12:11 pm    Post subject: Re: EVariantTypeCastError When Using SQL Server Reply with quote




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





PostPosted: Sat May 22, 2004 5:38 pm    Post subject: Re: EVariantTypeCastError When Using SQL Server Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.