Re: Cannot attach to Services Manager

From: Wayne & Carr (no_at_spam.com)
Date: 09/25/04


Date: Sat, 25 Sep 2004 13:48:03 -0500

Hello: ["Viatcheslav V. Vassiliev"];
>
> 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;
> //-----------------------------------------------

Thank you for your time and the code sample.
I imported the [Microsoft Jet and Replication Objects 2.6]
And the import was successful.

In the code:
==============
> //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;
==============
Password = ?? Does this mean that I have to assign the Username & Password
To the Database Connection in [TADOTable] In order to use this?
As I attempted to connect to my Database with the "UserID & PassW" and it
gave me
An error.

This is what I get when I run the project and then try to backup:

---------------------------
Debugger Exception Notification
---------------------------
Project CFF_KB_Admin.exe raised exception class EOleException with message
'Authentication failed'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------

And this is the line that it stops at:
 engine.CompactDatabase(src, dst);

I know that by the "Exceptin" That it cannot Authenticate me access the
Database.
Even though I am already in it.
Could you perhaps provide a little more informaiton on this please?

Thank You
Wayne