Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File Must Be Open Exclusively?

Status
Not open for further replies.

JohnC112461

Programmer
Sep 30, 2010
1
US
I create a temporary table as part of a report in a program in a multi user environment and when I select the temporary table and try to index it, I get a message "File Must Be Open Exclusively" repeatedly, yet when I show one of the Systems personnel and he tries it, he does not get the message. He cannot duplicate the error. WHy do I get the error and he doesn't?
 
There could be a dozen reasons why this is happening. But we know nothing about the environment in which you are working, or what is different when you show the problem to the other guy. So any answer would be a guess.

That said, my advice would be to forget about creating a temporary table, and create a cursor instead. Cursors always have exclusive use, so the problem should never arise.

If you create a cursor by using SELECT .... INTO CURSOR ..., be sure to add a READWRITE clause. You won't be able to index the cursor if it's read-only.

Hope this helps.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
I agree with Mike's suggestion above.

BUT IF you feel you must create a temporary table, then create it in a directory on the local workstation so that there won't be any contention between users who might inadvertently be trying to make the same temp table when another user does.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top