Home > Back-end >  The Message "Could not convert variant of type (Null) into type (String)".
The Message "Could not convert variant of type (Null) into type (String)".

Time:10-07

Each master: I'm doing a database application, with the three ADOTable: ADOTable - & gt; Active=true; There is also a ADOConnection
I appeared the following dialog at compile time: I can't find out where the problem is: give advice or comments please! Thank you very much!

Project aa. Exe raised exception clsaa EVariantTypeCastError With Message "Could not convert variant of type (Null) into type (String)". The Proces stopped. Use Step or Run to continue

CodePudding user response:

This is a pop-up message at runtime?

CodePudding user response:

The development environment,
Which specific lines of code

CodePudding user response:

First can prompt error, this is not a compile time is a runtime error. Second, you need to put up a specific access code field, which is to help you analyze a problem with the line.

CodePudding user response:

String STR=Field - & gt; The Value;//this code may be such a hint, when the prompt, slightly different database engines,
You single-step run it and see the problem is where the lines of code,

The Field - & gt; Value as the return type is a Variant Value is NULL, the transition to the String will be abnormal, the NULL is not equal to an empty String, the String can't express NULL.
In the Field - & gt; AsString NULL when it returns an empty string, no abnormalities,
  • Related