TADOConnection encapsulates the ADO connection object. Use TADOConnection for connecting to ADO data stores. The connection provided by a single TADOConnection component can be shared by multiple ADO command and dataset components through their Connection properties.
function CreateAccessDatabase(FileName: string): string;
var
cat: OLEVariant;
begin
Result := '';
try
cat:= CreateOleObject('ADOX.Catalog');
cat.Create('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + FileName + ';');
cat:= NULL;
except
writeln(ExceptionToString(ExceptionType, ExceptionParam));
writeln('ADOX.Catalog create failed ');
//on e: Exception do Result := e.message;
end;
end;
Works fine with OLEVariant and helpers_:
Function GetOleVariantEnum( Collection : OLEVariant) : IGetOleVariantEnum);
Function GetOleVariantArrEnum( Collection : OLEVariant) : IGetOleVariantEnum);
TADOConnection encapsulates the ADO connection object. Use TADOConnection for connecting to ADO data stores. The connection provided by a single TADOConnection component can be shared by multiple ADO command and dataset components through their Connection properties.