Solved

In Unlock necessary when closing locked files.

Posted on 1997-08-16
1
269 Views
Last Modified: 2008-03-06
I'm writing a VB4 CGI chat program and for the first time felt it necessary to lock files when reading and writing to them. When I lock my files I lock them in the Open statement i.e.

Open IndexFile For Random Lock Read Write As #FN.

When I was looking through the help files I came across the Lock # and Unlock # commands for locking individual records or bytes in a random access or binary file and noticed a warning that closing the file without using the Unlock # command could cause unpredictable results. Dose this apply only to files with individual records locked with the Lock # command after the open statement or should I unlock any files opened with the locking done in the Open statement as well?
0
Comment
Question by:grobin
1 Comment
 
LVL 5

Accepted Solution

by:
y96andha earned 50 total points
Comment Utility
This only applies to files locked with the Lock # command, not to files locked with the Open statement.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

771 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now