Board index » cppbuilder » Could not convert variant of type (OleStr) into type (Double)

Could not convert variant of type (OleStr) into type (Double)


2005-07-07 04:17:07 AM
cppbuilder15
Hi,
This is nightmare!
The code for determining the ADO version installed on
the system, which worked for years suddenly stopped
working on my machine. In fact all my EXE's that have
that code included stoped working with Error message:
"Could not convert variant of type (OleStr) into type (Double)"
When I start the EXE from the IDE, the program stopped
at line I marked:
double GetADOVersion()
{
CoInitialize( NULL );
double Result = 0.0;
try
{
Variant Ado;
Ado = CreateOleObject( "ADODB.Connection" );
Result = Ado.OlePropertyGet ( "Version" ); // <--- HERE
Ado.Clear();
}
__finally
{
CoUninitialize();
}
return( Result );
}
Commenting this code with returning fake true result made the program
working again...
What have I messed? Something with Borland's DLL/BPL or is something
in the system?
--
Best regards,
Vladimir Stefanovic
 
 

Re:Could not convert variant of type (OleStr) into type (Double)

False alarm!
DecimalSeparator = '.';
...solved my problem. In fact there was some code that was calling
GetADOVersion() and further comparing values, and somehow
de{*word*81} stopped at the place that wasn't descriptive enough, in the
middle of the shown function.
--
Best regards,
Vladimir Stefanovic