The Session object to which the database, query, or stored procedure is assigned.

Property of

Database, Query, StoredProc

Description

A database must be assigned to a session. When a Database object is created, it's automatically assigned to the default session.

A query or stored procedure must be assigned to a database, which in turn is assigned to a session. When created, a Query or StoredProc object is assigned to the default database in the default session.

To assign either the Query, or StoredProc, object to the default database in another session, assign that session to their session property. Assigning a Query or StoredProc's session property always sets their database property to the default database in that session.

To assign either the Query, or StoredProc, object to another database in another session, assign the object to that session first. This makes the databases in that session available to the object.

To enable the Session object's security features, the database the Session object is assigned to must be active.