Help reindex & I Don't have a handle on handles 
Author Message
 Help reindex & I Don't have a handle on handles

I'm trying to call the BDE function DBIRegenIndexes(wwTable1.handle).
Syntatically the program is fine, but it always crashes with "invalid handle
to the function". I have included BDE in the uses etc. I guess I don't
understand handles enought to understand exactly why this won't work.

Any help apprieciated.

Rich




Sun, 01 Apr 2001 03:00:00 GMT  
 Help reindex & I Don't have a handle on handles

Quote:

>I'm trying to call the BDE function DBIRegenIndexes(wwTable1.handle).
>Syntatically the program is fine, but it always crashes with "invalid handle
>to the function". I have included BDE in the uses etc. I guess I don't
>understand handles enought to understand exactly why this won't work.

This error occurs when the dataset component is inactive and needs to be
active, otherwise there is no valid handle to the table. For example:

  procedure TForm1.Button4Click(Sender: TObject);
  var
    aExclusive, aActive: Boolean;
  begin
    with Table1 Do Begin
      aActive := Active;
      Close;
      aExclusive := Exclusive;
      Exclusive := True;
      Open;
      Check(DbiRegenIndexes(Table1.Handle));
      Close;
      Exclusive := aExclusive;
      Active := aActive;
      Check(DbiSaveChanges(Table1.Handle));
    end;
  end;

//////////////////////////////////////////////////////////////////////////
Steve Koterski                      "The knowledge of the world is only to
Technical Publications              be acquired in the world, and not in a
INPRISE Corporation                 closet."
http://www.inprise.com/delphi          -- Earl of Chesterfield (1694-1773)



Sun, 01 Apr 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Ann: ChimneySweep service-update released to handle pack/reindex w/multiple passwords

2. HELP Exception handling doesn't work

3. 'Error creating cursor handle'

4. InfoPower QBE: 'Error creating cursor handle'

5. Clarification: on ChimneySweep's new handling of memo-field repairs

6. PARAMSTR Versus ARGV - Pascal handling of Parameters to EXE's

7. Finding a window handle & sending messages

8. Variables in CodeSegment & Interrupt handling

9. Interbase & IDAPI Transaction handling question

10. Finding a window handle & sending messages

11. Pdox Date field & handling invalid entry

12. SQL won't handle WHERE clause??

 

 
Powered by phpBB® Forum Software