An object that manages simultaneous database access.

Syntax

[<oRef> =] new Session( )

<oRef>

A variable or property—typically of a Form or Report object—in which to store a reference to the newly created Session object.

Properties

The following tables list the properties, events, and methods of the Session class. For details on each property, click on the property below.

Property

Default

Description

baseClassName

SESSION

Identifies the object as an instance of the Session class

className

(SESSION)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

handle

 

BDE session handle

lockRetryCount

0

Number of times to retry a failed lock attempt

lockRetryInterval

0

Number of seconds to wait between each lock attempt

name

Empty string

The name of custom object. Read-only.

parent

null

Container form or report

 

Event

Parameters

Description

beforeRelease

 

Before the object is released

onProgress

<percent expN>,
<message expC>

 

Periodically during data processing operations

Method

Parameters

Description

access( )

 

Returns the user’s access level for the session

addAlias()

<cAlias>, <cDriver>, <cOptions>

adds a User BDE Alias to the current BDE session

addPassword( )

<password expC>

Adds a password to the password table for access to encrypted DB (Paradox) tables

deleteAlias()

<cAlias>

Deletes a User BDE Alias from the current BDE session

login( )

<group expC>,
<user expC>,
<password expC>

Logs the specified user into the session to access encrypted DBF (dBASE) tables

user( )

 

Returns the user’s login name for the session

Description

A session represents a separate user task, and is required primarily for DBF and DB table security. dBASE Plus supports up to 2048 simultaneous sessions. When dBASE Plus first starts, it already has a default session.

DBF and DB table security is session-based. (SQL-table security is database-based.) To enable the Session object's security features, the database it is assigned to must be active. When you create a new Session object, it copies the security settings of the default session. Therefore, if you have a user log in when dBASE Plus starts, all the new sessions you create to handle multiple tasks will have the access level.

Unlike the Database and Query objects, a Session object does not have an active property. Sessions are always active. To close a session, you must destroy it by releasing all references to it.