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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

table in use problem

Status
Not open for further replies.

yellowke

Programmer
Nov 5, 2002
48
BE
Hi,

Here is the problem:

I alter some data in a table
Then I print a report from a record of that table
And then when I want to alter some data of an other record of that table I get the message: table in use.

How can I unlock the table?

Use didn't work.

Greets

 
unlock in TheTable

This only works if it is YOUR lock that's "holding" the table.

Rob.
 
no That doesn't work.

btw: The message is actually: File in use

 
Hi

Some where you are opening the table in a wrong way. You may not be opening the table only in Data environment. Probably, you are opening the table just before you do the report again.. SO I assume you must be opeing the table as given below..

SELECT 0
USE myTable ALIAS myTable .... with some order

Instead change those lines to..

IF USED("myTable")
SELECT 0
USE myTable ALIAS myTable
ELSE
SELECT myTable
ENDIF

This will avoid the duplicate opening attempt and solve your problem.

:)

ramani :)
(Subramanian.G)
 
I think ramani is on the right track.

For example.

USE employee ALIAS ee

IF USED("employee")
MESSSAGEBOX("USED")
ELSE
MESSAGEBOX("NOT USED")
ENDIF

Output Message = "NOT USED"
 
I use the following code all the time. I think RAMANI may have meant to open the table if it is not used or !USED()

IF !USED("myTable")
SELECT 0
USE myTable ALIAS myTable
ELSE
SELECT myTable
ENDIF

If you're using a form, not the BROWSE command, check the form's .BufferMode property or the DataEnvironment.Cursor1.BufferModeOverride property. If there is buffering set, then you may have to call the "TableUpdate(.T., .T.)" function to commit changes before moving to the next record.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top