VB6 Unlock statement syntax: - Unlock [#]filenumber[, recordrange] Removes access restrictions on all or part of an open file. The Unlock statement syntax has these parts:
| Part | Description |
|---|---|
| filenumber | Required. Any valid file number. |
| recordrange | Optional. Range of records to unlock. Can be: record, start To end, or omitted for entire file. |
Remarks
- Unlock is used to remove locks placed on a file with the Lock statement.
- The arguments to Unlock must exactly match those used with the corresponding Lock statement.
- For Binary, Input, or Output mode, Unlock always unlocks the entire file regardless of recordrange.
- For Random mode, Unlock unlocks the specified record or range of records.
Examples
Unlock #1
Unlock #1, 5
Unlock #1, 10 To 20