PESessionInfo
PESessionInfo contains information about the current Microsoft Access session. Many Microsoft Access database tables require that a session be opened before the table can be used. Use this structure with PEGetNthTableSessionInfo to retrieve current information and PESetNthTableSessionInfo to pass new information.
C Syntax
typedef struct PESessionInfo {
WORD StructSize;
char UserID [PE_SESS_USERID_LEN];
char Password [PE_SESS_PASSWORD_LEN];
DWORD SessionHandle;
};
Members
StructSize
| Specifies the size of the PESessionInfo structure. Initialize this member to PE_SIZEOF_SESSION_INFO.
|
UserID
| Specifies the user ID value (of length PE_SESS_USERID_LEN = 128) needed for logging on to the system.
|
Password
| Specifies the password (of length PE_SESS_PASSWORD_LEN = 128) needed for logging on to the system. Password is undefined when getting information from a report.
|
SessionHandle
| The handle to the current MS Access session. When setting information, if SessionHandle = 0, the UserID and Password settings are used; otherwise the SessionHandle is used. SessionHandle is undefined when getting information from a report.
|
Remarks
In Microsoft Access 95 and later, an Access database can have session security (also known as user-level security), database-level security, or both.
- If the Access database contains only session security, simply pass the session password to the Password member before calling PESetNthTableSessionInfo.
- If the Access database contains database-level security, use a newline character, '\n' (ASCII character 10) followed by the database-level password (for example, "\ndbpassword").
- If the Access database contains both session security and database-level security, use the session password followed by the newline character and the database password (for example, "sesspswd\ndbpassword").
- Alternately, database-level security can also be handled by assigning the database-level password to the Password member of PELogOnInfo and calling PESetNthTableLogOnInfo.
VB Type Listing
Type PESessionInfo
StructSize As Integer
UserID As String * PE_SESS_USERID_LEN
Password As String * PE_SESS_PASSWORD_LEN
SessionHandle As Long
End Type
Delphi Record Listing
type
PESesPassType = array[1..PE_SESS_PASSWORD_LEN] of char;
PESessionInfo = record
StructSize: Word;
UserID: PESesPassType;
Password: PESesPassType;
SessionHandle: DWord;
end;