|
of_init
|
|
Full name
|
pfc_n_cn.of_init
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_init(string)
|
Name
|
Datatype
|
li_rc
|
integer
|
ls_application
|
string
|
ls_connectstring
|
string
|
ls_driver
|
string
|
ls_location
|
string
|
ls_options
|
string
|
ls_password
|
string
|
ls_trace
|
string
|
ls_userid
|
string
|
public function integer of_init (string as_registrykey);////////////////////////////////////////////////////////////////////////////
//
// Function: of_init
//
// Access: public
//
// Arguments:
// as_registrykey The registry key path to read values from.
//
// Returns: integer
// 1 if no errors are encountered.
// -1 if an error is encountered.
//
// Description: Initializes connection object's properties with
// values from the registry. Values that are not found
// will be defaulted to an empty string.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 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.
//
//////////////////////////////////////////////////////////////////////////////
string ls_driver='', ls_application=''
string ls_location='', ls_connectstring=''
string ls_userid='', ls_password=''
string ls_options='', ls_trace=''
integer li_rc
//Check arguments
If IsNull(as_registrykey) or Len(Trim(as_registrykey))=0 Then
Return -1
End If
//If available, get each value from the registry.
li_rc = RegistryGet (as_registrykey, 'Driver', ls_driver)
li_rc = RegistryGet (as_registrykey, 'Application', ls_application)
li_rc = RegistryGet (as_registrykey, 'Location', ls_location)
li_rc = RegistryGet (as_registrykey, 'ConnectString', ls_connectstring)
li_rc = RegistryGet (as_registrykey, 'UserID', ls_userid)
li_rc = RegistryGet (as_registrykey, 'Password', ls_password)
li_rc = RegistryGet (as_registrykey, 'Options', ls_options)
li_rc = RegistryGet (as_registrykey, 'Trace', ls_trace)
//Initialize the connect object.
this.Driver = ls_driver
this.Application = ls_application
this.Location = ls_location
this.ConnectString = ls_connectstring
this.UserID = ls_userid
this.Password = ls_password
this.Options = ls_options
this.Trace = ls_trace
Return 1
end function
Name
|
Owner
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.registryget |
systemfunctions
|
systemfunctions.trim |
systemfunctions
|