Re: Cannot attach to Services Manager

From: Viatcheslav V. Vassiliev (support_at_oledbdirect.com)
Date: 09/25/04

  • Next message: Viatcheslav V. Vassiliev: "Re: Show all Tables in Database and Choose with "TabSheet""
    Date: Sat, 25 Sep 2004 11:52:39 +0400
    
    

    TIBBackupService is T(InterBase)BackupService - it will not work with MS
    Access databases, as well it will not work with MS SQL Server, Oracle and
    other DBMS, only with Interbase (may be with Firebird too).

    To compact Access database import "Microsoft Jet and Replication Objects 2.6
    Library" and execute:

    //----------------------------------------------
    uses JRO_TLB;

    {$R *.dfm}

    procedure TForm1.Button1Click(Sender: TObject);
    var
     engine: IJetEngine;
     src, dst: WideString;
    begin

     //src is connection string to existing database with old password
     src := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + oldFileName;
     //dst is connection string to compacted db with new password
     dst := 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + newFileName;

     engine := CoJetEngine.Create();
     engine.CompactDatabase(src, dst);
    end;
    //-----------------------------------------------
    Regards,
    Vassiliev V. V.
    http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
    ADO.Net
    http://www.oledbdirect.com - The fastest way to access MS SQL Server,
    MS Jet (Access) and Interbase (through OLEDB)

    "Wayne & Carr" <no@spam.com> сообщил/сообщила в новостях следующее:
    news:4154f751$1@newsgroups.borland.com...
    > Hello All; [ Delphi 6.02 Pro | Win2K Pro ]
    >
    > I am using the [ TIBBackupService ];
    > And am trying to connect and backup a " Access Database "
    > Using the following code from the Delphi-Help.
    > ( The code it self may be the problem ? As it was showing a different
    > database extension )
    >
    > =================
    > procedure TCFF_Admin.Save1Click(Sender: TObject);
    > begin
    > with IBBackupService1 do
    > begin
    > ServerName := 'Poulet';
    > LoginPrompt := False;
    > //Params.Add('user_name=sysdba');
    > //Params.Add('password=masterkey');
    > Active := True;
    > try
    > Verbose := True;
    > Options := [NonTransportable, IgnoreLimbo];
    > DatabaseName :=
    > '\\Carrz-server\G\Inetpub\wwwroot\Carrz\KB\data\FireKB.mdb';
    > BackupFile.Add('M:\InetPub\wwwroot\Carrz\KB\data\FireKB.mdb');
    >
    > ServiceStart;
    > While not Eof do
    > Memo1.Lines.Add(GetNextLine);
    > finally
    > Active := False;
    > end;
    > end;
    >
    > end;
    > =================
    > I recevie the following error when I try to "Save":
    >
    > ---------------------------
    > Debugger Exception Notification
    > ---------------------------
    > Project CFF_KB_Admin.exe raised exception class EIBInterBaseError with
    > message 'Cannot attach to services manager'. Process stopped. Use Step or
    > Run to continue.
    > ---------------------------
    > OK Help
    > ---------------------------
    >
    > Could someone please let me know what to look for to resolve this?
    > Or if it is the code, could someone please provide the proper code? Or a
    > link ?
    >
    > Thank You All
    > Wayne
    >
    >


  • Next message: Viatcheslav V. Vassiliev: "Re: Show all Tables in Database and Choose with "TabSheet""