|
of_Init
|
|
Full name
|
pfc_n_tr.of_Init
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_Init(string)
|
Name
|
Datatype
|
li_rc
|
integer
|
lnv_conversion
|
n_cst_conversion
|
ls_autocommit
|
string
|
ls_database
|
string
|
ls_dbms
|
string
|
ls_dbparm
|
string
|
ls_dbpass
|
string
|
ls_lock
|
string
|
ls_logid
|
string
|
ls_logpass
|
string
|
ls_servername
|
string
|
ls_userid
|
string
|
public function integer of_Init (string as_registrykey);//////////////////////////////////////////////////////////////////////////////
// Public Function: of_Init
// Arguments: as_registrykey the registry key to read values from
// Returns: integer
// 1 = success
// -1 = error
// Description: Initializes transaction object's properties with values from
// the registry. Values that are not found will be defaulted to an empty string.
//////////////////////////////////////////////////////////////////////////////
// Rev. History Version
// 5.0 Initial version
//////////////////////////////////////////////////////////////////////////////
// Copyright © 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved. Any distribution of the
// PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//////////////////////////////////////////////////////////////////////////////
integer li_rc
string ls_dbms
string ls_database
string ls_logid
string ls_logpass
string ls_servername
string ls_userid
string ls_dbpass
string ls_lock
string ls_dbparm
string ls_autocommit
n_cst_conversion lnv_conversion
// Check arguments
if IsNull (as_registrykey) or Len (Trim (as_registrykey)) =0 then return -1
// If available, get each individual value.
li_rc = RegistryGet (as_registrykey, 'DBMS', ls_dbms)
li_rc = RegistryGet (as_registrykey, 'Database', ls_database)
li_rc = RegistryGet (as_registrykey, 'LogID', ls_logid)
li_rc = RegistryGet (as_registrykey, 'LogPassword', ls_logpass)
li_rc = RegistryGet (as_registrykey, 'ServerName', ls_servername)
li_rc = RegistryGet (as_registrykey, 'UserID', ls_userid)
li_rc = RegistryGet (as_registrykey, 'DatabasePassword', ls_dbpass)
li_rc = RegistryGet (as_registrykey, 'Lock', ls_lock)
li_rc = RegistryGet (as_registrykey, 'DBParm', ls_dbparm)
li_rc = RegistryGet (as_registrykey, 'AutoCommit', ls_autocommit)
// Initialize this object
this.DBMS = ls_dbms
this.Database = ls_database
this.LogID = ls_logid
this.LogPass = ls_logpass
this.ServerName = ls_servername
this.UserID = ls_userid
this.DBPass = ls_dbpass
this.Lock = ls_lock
this.DbParm = ls_dbparm
this.Autocommit = lnv_conversion.of_Boolean (ls_autocommit)
if IsNull (this.Autocommit) then this.Autocommit = false
return 1
end function
Name
|
Owner
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.registryget |
systemfunctions
|
systemfunctions.trim |
systemfunctions
|
pfc_n_cst_conversion.of_boolean |
pfc_n_cst_conversion
|