User Tools

Site Tools


clarion_driver_strings.htm
Navigation:  ISAM File Drivers > Clarion Database Driver >====== Clarion:Driver Strings ====== Previous pageReturn to chapter overviewNext page

There are switches or “driver strings” you can set to control the way your application creates, reads, and writes files with a specific driver. Driver strings are simply messages or parameters that are sent to the file driver at run-time to control its behavior. See Common Driver Features–Driver Strings for an overview of these runtime Database Driver switches.

NoteBox.jpg

Some driver strings have no effect after the file is open, so no SEND function syntax is listed for those strings. However, the SEND function syntax to return the value of the switch is listed for all driver strings.

The Clarion Driver supports the following Driver Strings:

DELETED

SEND(file, 'DELETED')

For use only with the SEND command when IGNORESTATUS is on. Reports the status of the loaded record. If deleted, the return string is “ON” and if not “OFF.”

HELD

SEND(file, 'HELD')

For use only with the SEND command when IGNORESTATUS is on. Reports the status of the loaded record. If held, the return string is “ON” and if not “OFF.”

IGNORESTATUS

DRIVER('Clarion', '/IGNORESTATUS = on | off' )

[ Status“ = ] SEND(file, 'IGNORESTATUS [ = on | off ]' )

When set on, the driver does not skip deleted records when accessing the file with GET(), NEXT(), and PREVIOUS() in file order. It also enables a PUT() on a deleted or held record. IGNORESTATUS requires opening the file in exclusive mode. However, any MEMO data of the deleted records is not recoverable. SEND returns the IGNORESTATUS setting (ON or OFF) in the form of a STRING(3).

MAINTAINHEADERTIME

DRIVER('Clarion', '/MAINTAINHEADERTIME = on | off' )

[ Status” = ] SEND(file, 'MAINTAINHEADERTIME [ = on | off ]' )

When set on, the driver maintains the file header time stamp (last updated) under all circumstances. When set to off (the default), the driver improves performance by ignoring the time stamp under some circumstances. SEND returns the MAINTAINHEADERTIME setting (ON or OFF) in the form of a STRING(3).

RECOVER

SEND(file, 'RECOVER = n' )

The RECOVER string, when n is greater than 0, UNLOCKs data files, RELEASEs held records, and rolls back incomplete transactions in order to recover from a system crash. See also Transaction Processing for Clarion Files.

n represents the number of seconds to wait before invoking the recovery process. When n is equal to 1, the recovery process is invoked immediately. When n is equal to 0, the recovery process is disarmed.

There are two ways of using RECOVER:

SEND(file, 'RECOVER=n')

OPEN(file)

This releases a LOCK on a file that was locked when a machine crashed. It also rolls back a transaction that was in process when a system crashed.

SEND(file, 'RECOVER=n')

GET or NEXT or PREVIOUS

This removes a hold flag from records that where held when a machine crashed. Here is a piece of code that removes all hold flags from a file:

OPEN(file)  !make sure no one else is using the file

SEND(file,'IGNORESTATUS=ON')

SET(file)

LOOP

NEXT(file)

IF ERRORCODE()

 BREAK

END

IF SEND(file,'HELD') = 'ON' THEN

 SEND(file,'RECOVER=1')

 REGET(file,POSITION(file))

END

END

RECOVER may not be used as a DRIVER string–you may only use it with the SEND function. The SEND function returns a blank string.

clarion_driver_strings.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1