DBASE indexing 
Author Message
 DBASE indexing

Hi!

I don't understand the following error message: the table cannot be
opened for exclusive use (or sg. similar).
In fact I'm using a table, and I want to search a record ( after
choosing an article name from a listbox, a dialogbox shows the whole
record). I used the AddIndex method to add an index for the table (and
searching with GotoKey), but the above error message appears. Where
should I look for the problem? Should I define an index in the Database
Desktop before? Is there any other idea for the searching ?
Any help will be appreciated.

Akos Horvath



Wed, 18 Jun 1902 08:00:00 GMT  
 DBASE indexing

Quote:

>I don't understand the following error message: the table cannot be
>opened for exclusive use (or sg. similar).
>In fact I'm using a table, and I want to search a record ( after
>choosing an article name from a listbox, a dialogbox shows the whole
>record). I used the AddIndex method to add an index for the table (and
>searching with GotoKey), but the above error message appears.

To add the index (using AddIndex), your table must be opened in
exclusive mode, i.e. no one else can use it at that time.

        MyTable.Close;
        MyTable.Exclusive := True;
        MyTable.Open;
        MyTable.Addindex .........
        MyTable.Close;
        MyTable.Exclusive := False;
        MyTable.Open;

After this, everyone should be able to use the table with the new
index again. Also, be aware that a number of those calls (especially
the open in exclusive mode) can fail when other users are using your
table at the same time.

HTH
Marc

======================================================================

======================================================================



Wed, 18 Jun 1902 08:00:00 GMT  
 DBASE indexing

Quote:

> Hi!

> I don't understand the following error message: the table cannot be
> opened for exclusive use (or sg. similar).
> In fact I'm using a table, and I want to search a record ( after
> choosing an article name from a listbox, a dialogbox shows the whole
> record). I used the AddIndex method to add an index for the table (and
> searching with GotoKey), but the above error message appears. Where
> should I look for the problem? Should I define an index in the Database
> Desktop before? Is there any other idea for the searching ?
> Any help will be appreciated.

> Akos Horvath


If your have more than one table referencing the same DBase file
you will get that error. You will also get that error while your
in Delphi and the table is Active because Delphi is a "user" of
the DBase file just like your program is. Before you can add
an index you must:
1.) close all tables referencing that dBase file
2.) make the Table exclusive
3.) Add the index
4.) set the exclusive variable back to false.
5.) reopen any tables you closed.


Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Incorrect dBASE Index

2. Detach dBase Index without DBD ?

3. Q: FindKey equivalent for dBASE indexes based on expressions

4. dbase indexes in delphi-2

5. Problems with MDX dbase indexes

6. BDE: Problems with SQL-Select and dBase-Indexes

7. BDE: SQL Queries and dBase Indexes (Performance?)

8. DBase Indexes With Delphi 1.0

9. dbase indexes

10. Problem with Findkey and dBase index

11. Functions used in dBase indexes

12. Recreating dBase Indexes at runtime: How?

 

 
Powered by phpBB® Forum Software