Hier meine MakeAccessDb.dpr:
Delphi-Quellcode:
program MakeAccessDb;
{$APPTYPE CONSOLE}
uses
SysUtils,
ComObj,
ActiveX,
Variants;
function CreateAccessDatabase(FileName:
string):
string;
var
cat: OLEVariant;
begin
Result := '
';
try
CoInitialize(
nil);
cat := CreateOleObject('
ADOX.Catalog');
cat.Create('
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + FileName + '
;');
cat := NULL;
except
on e:
Exception do Result := e.
message;
end;
end;
begin
WriteLn(CreateAccessDatabase(ParamStr(1)));
{ TODO -oUser -cConsole Main : Hier Code einfügen }
end.