Create a simple logon session.
Ora8.bdh
Ora8Logon( in hEnv : number, out hSvcCtx : number, in sUser : string, in sPassword : string optional, in sConnect : string optional, in nMode : number optional): boolean;
true if successful
false otherwise; In this case, you can use the Ora8OciError function to retrieve the Oracle OCI error code.
Parameter | Description |
---|---|
hEnv | The environment handle. |
hSvcCtx | Variable receiving the initialized service context handle. |
sUser |
User Identification. This parameter contains either only the user name or the user name, the password, and the host machine identifier. In the latter case, it is necessary to insert a / character between the user name and the password, and a @ character between the password and the connect string. Valid examples are shown below:
|
sPassword | Password (optional). If the password is specified through the sUser parameter, this parameter should be omitted or set to NULL. |
sConnect | SQL*Net connect descriptor (optional). If the connect string is passed through the sUser parameter, this parameter should be omitted. |
nMode |
Specifies the various modes of operation (optional). Valid values are:
|
var ghEnv0 : number; ghError0 : number; ghSvcCtx0 : number; bOK : boolean; dcltrans transaction TMain begin Ora8Init(ghEnv0, OCI_DEFAULT); Ora8HandleAlloc(ghEnv0, ghError0, OCI_HTYPE_ERROR); bOK := Ora8Logon(ghEnv0, ghSvcCtx0, "user", "password", "orclnet2"); if bOk then write("Connection to database established."); writeln; else write("Error connecting to database."); writeln; end; ... Ora8Logoff(ghSvcCtx0); Ora8HandleFree(ghError0, OCI_HTYPE_ERROR); Ora8HandleFree(ghEnv0, OCI_HTYPE_ENV); end TMain;
Connection to database established.