Board index » delphi » Invalid Variant Type Conversion error

Invalid Variant Type Conversion error

I am getting this error randomly when adding new rows to the detail
table of a master detail set.  I have no clue what is wrong.  I have
changed anywhere I used ".value" to ".AsString" or whatever the
appropriate "AsXxxxx" would be.  I don't get the error until I try to
post the updates.  I am using cached updates.  The database is a Sybase
SqlAnywhere 6.0.4.  I am terrible at debugging, any help would be most
appreciated.  This error just started occurring out of the blue, I
haven't made any change that would cause this as far as I know.  Could
it be a problem with the database?  Thanks.
 

Re:Invalid Variant Type Conversion error


You might want to post this question in the database.sqlservers group also.
You are more likely to find others with SQL Anywhere experience there.

--
Bill
(TeamB cannot answer questions received via email)

Re:Invalid Variant Type Conversion error


Oh, I've seen it .. never could explain it .. wound up writing code to
detect it and "eat" it .. and that code has been in service for six
years now without a hitch.  Never DID explain it...  :-/
Quote
>Bill Todd (TeamB) wrote:

> You might want to post this question in the database.sqlservers group also.
> You are more likely to find others with SQL Anywhere experience there.

> --

Re:Invalid Variant Type Conversion error


I have posted it there, twice, but I have received no replies as of yet.  I
really need some help with this, it continues to frustrate me.  I have an older
version of the .exe file that doesn't give the error, but I have changed
something on the form somewhere I guess that now causes this error.  I have
scoured the code and can't see what I might have changed that would cause this
error.  I was working on some changes to the form that weren't finished yet
when another change was requested that was quick to do.  I put a copy of the
form 'in progress' in another directory and then copied the files for the form
from the server(my backup files) so that I could do the smaller change right
away and not have to finish the changes I had already started for the larger
revision.  Would this have screwed things up?  I have tried putting the 'form
in progress' back and undoing the changes I had started, but that hasn't worked
either.  Is there an easy way to find out which field it is having trouble
updating?  Thanks.
Quote
"Bill Todd (TeamB)" wrote:
> You might want to post this question in the database.sqlservers group also.
> You are more likely to find others with SQL Anywhere experience there.

> --
> Bill
> (TeamB cannot answer questions received via email)

Re:Invalid Variant Type Conversion error


Let me start by saying that I know nothing about SQL Anywhere. I asume you
are connecting to it using either the BDE or ADO and an ODBC driver. Is that
correct?

Invalid variant type conversion occurs when you try to assign a variant to a
typed variable and the value of the variant cannot be converted to that
type. The most common case is when the variant is null and you try to assign
it to a variable type that cannot have the null state.

From what you have said I cannot suggest any way to find the problem except
single stepping in the de{*word*81} if you can reproduce the error at will.

--
Bill
(TeamB cannot answer questions received via email)

Re:Invalid Variant Type Conversion error


[disclaimer] I know zip about SQL Anywhere

but had similar problem with Interbase - turned out to be NULL field
values. I had to check IsNull before doing anything with the data.

HTH

On Wed, 13 Feb 2002 10:56:20 -0700, Rhea Urusky

Quote
<rh...@beaverplastics.com> wrote:
>I have posted it there, twice, but I have received no replies as of yet.  I
>really need some help with this, it continues to frustrate me.  I have an older
>either.  Is there an easy way to find out which field it is having trouble
>updating?  Thanks.

>"Bill Todd (TeamB)" wrote:

>> You might want to post this question in the database.sqlservers group also.
>> You are more likely to find others with SQL Anywhere experience there.

---
Sarah
[not a 'SQL smartie' yet!]

Other Threads