Thread View: borland.public.cppbuilder.database.ado
2 messages
2 total messages
Started by Vladimir Stefanovic
Wed, 06 Jul 2005 20:17
Could not convert variant of type (OleStr) into type (Double)
Author: Vladimir Stefanovic
Date: Wed, 06 Jul 2005 20:17
Date: Wed, 06 Jul 2005 20:17
44 lines
1847 bytes
1847 bytes
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)
Author: Vladimir Stefanovic
Date: Wed, 06 Jul 2005 20:36
Date: Wed, 06 Jul 2005 20:36
14 lines
1282 bytes
1282 bytes
False alarm! DecimalSeparator = '.'; ...solved my problem. In fact there was some code that was calling GetADOVersion() and further comparing values, and somehow debugger stopped at the place that wasn't descriptive enough, in the middle of the shown function. -- Best regards, Vladimir Stefanovic
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads