Board index » delphi » Compact/Repair

Compact/Repair

D5ent,updated - MSA2K

I've used JRO type lib. and the procedure as given by BBushey on prev.posts
eg
procedure TMainForm.CompactDataBa{*word*224}uClick(Sender: TObject);
var JROJetEngine: TJROJetEngine;
    strTempDBPath,
    strSource,
    strDest,
    strJetVersion: string;
    iLength: integer;
begin
  if strGlobalAccessVersion = '2000' then
    strJetVersion := '5'  { Access 2000}......................etc

However it I get an error at the following line;

<     if not dbModule.CloseAll then
        begin
          MessageDlg('Error closing some datasets, unable to compact',
mtError, [mbOk], 0);
          exit;
  >
 I substituted name of my DM for 'dbmodule',
can find no listing for 'CloseAll'
It appears dbmodule is remaining open, tho I've also tried closing
connection.

Any guidence appreciated,
David

 

Re:Compact/Repair


Quote
> I substituted name of my DM for 'dbmodule',
>can find no listing for 'CloseAll'
>It appears dbmodule is remaining open, tho I've also tried closing
>connection.

Set the TadoConnection.connected property to false will disconnect all the
dataset components connected to it

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Compact/Repair


Thanks, but am still puzzled by the error generated by 'CloseAll'
David

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:bo29vto1m6ri4q21bbhmklojaq5qodufuk@4ax.com...

Quote

> > I substituted name of my DM for 'dbmodule',
> >can find no listing for 'CloseAll'
> >It appears dbmodule is remaining open, tho I've also tried closing
> >connection.

> Set the TadoConnection.connected property to false will disconnect all the
> dataset components connected to it

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:Compact/Repair


Quote
> but am still puzzled by the error generated by 'CloseAll'

The code you sited was intended to be an example of using compact not code you
could directly paste in your app end use.

You can go ahead and create your own closeAll method

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Compact/Repair


Thanks, I had modified the rest of the code, but did'nt realise this was a
'new' method.
My origonal query,error occured as I had created a 2nd DM, and was
forgetting to disconnect this!!
David

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:o0mbvtsnifkbcrnfrl3hcisvdp77p9kgtn@4ax.com...

Quote

> > but am still puzzled by the error generated by 'CloseAll'

> The code you sited was intended to be an example of using compact not code
you
> could directly paste in your app end use.

> You can go ahead and create your own closeAll method

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Other Threads