Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set exclusive ON
Message
 
To
26/05/2002 06:02:07
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00661433
Message ID:
00661436
Views:
31
Wang,

... But however when I perform a SQL insert command to one of the table and follow by a reindex, it message "table need to be open exclusive". ...

reindexing is something that should only be done for maintenance-reasons. If You are using compound-indices (CDX-Files), what is the normal case, all indices will be maintained automatically as soon as You insert, append, replace or do whatever with the table. So the reindex in this case ist not necessary. Even more it can
be *killing* Your performance when You have lager tables. With a few hundret thousand records and more than one index in a table, reindex will take several minutes before You can work on.

Even more as soon as You start to go *networking* (and believe me, one day a customer will come and ask "can I do this from two workstations too?") it is almost impossible to use tables (except local temp-files) exclusively.

However back to You question

I try to put set exclusive on at the start of the code but same message appear.


if You issue
if used(<ALIAS>)
  use <ALIAS> in ALIAS exclusive
else 
  select 0
  use <ALIAS> exclusive
endif

insert into <ALIAS> ...

....

*-- just in case
select <ALIAS>
reindex
If You try to use a table exclusively, You get either an error-msg (if not switched off)
or the table is open exclusive. So if You get the message "...needs to be opened exclusively"
chances are high, that You have not actually selected the correct alias before.

HTH
Regards from Berlin

Frank

Dietrich Datentechnik (Berlin)
Softwarekombinat Teltow (Teltow)

Frank.Dietrich@dd-tech.de
DFPUG # 327
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform