[TRUCO DELPHI] Leer la version de ADO.
uses ComObj; function GetADOVersion: Double; var ADO: OLEVariant; begin try ADO := CreateOLEObject('adodb.connection'); Result := StrToFloat(ADO.Version); ADO := null; except Result := 0.0; end; end;
Saludos!
Escrito 01 diciembre 2016 - 07:55
[TRUCO DELPHI] Leer la version de ADO.
uses ComObj; function GetADOVersion: Double; var ADO: OLEVariant; begin try ADO := CreateOLEObject('adodb.connection'); Result := StrToFloat(ADO.Version); ADO := null; except Result := 0.0; end; end;
Saludos!
Escrito 01 diciembre 2016 - 03:44
No se deberia liberar la memoria asignando Unnasigned?
Eso mismo dice la wiki
Tip: As shown in the example, if the interface returned by [/size]CreateOleObject is assigned to a Variant, you can release the interface by assigning the Unassigned constant to that Variant.[/size]
Aunque yo prefiero usar el procedimiento VarClear
Editado por Agustin Ortu, 01 diciembre 2016 - 03:45 .
Escrito 02 diciembre 2016 - 06:48
Quizas ADO:= null y VarClear tienen el mismo efecto... Habria que ver ambas en ejecucion.
Saludos!