Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

File Lock???

Posted on 2000-04-07
3
Medium Priority
?
188 Views
Last Modified: 2010-04-04
I have a text file (the size about 3 Mb).
I read that file and store it to table (TTable).
After all process done, and I close the file using command: system.close(FileVar).
After that I move file to specified folder using API function MoveFile.
The problem is sometimes, it returns error, called ERROR_ACCESS_DENIED
(get from GetLastError function).
It seems that the system still locks the file.
How to solve this problem?

Need help from any Delphi Expert

Daniel
0
Comment
Question by:daniel_c
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:dhertzfe
ID: 2693300
Are you using Windows NT?

I had this same problem with NT.  I solved the problem by adding a Sleep(200) after closing the file.
0
 
LVL 2

Accepted Solution

by:
PeterLarsen earned 100 total points
ID: 2693983
Hi daniel c,

I have had a similar problem some time ago :

http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10109545 

Good luck
Peter
0
 
LVL 7

Author Comment

by:daniel_c
ID: 2695714
Thanks Peter!!!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question