|
of_init
|
|
Full name
|
pfc_n_cn.of_init
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_init(string,string)
|
public function integer of_init (string as_inifile, string as_inisection);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_init
//
// Access: public
//
// Arguments:
// as_inifile .INI file to read values from.
// as_inisection Section within .INI file where connect object values are.
//
// Returns: integer
// 1 if no errors are encountered.
// -1 if an error is encountered.
//
// Description: Initializes connect object's properties with
// values from an .INI file. 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.
//
//////////////////////////////////////////////////////////////////////////////
//Check arguments
If IsNull(as_inifile) or IsNull(as_inisection) or &
Len(Trim(as_inifile))=0 or Len(Trim(as_inisection))=0 or &
(Not FileExists(as_inifile)) Then
Return -1
End If
//Initialize the connect object.
this.Driver = ProfileString (as_inifile, as_inisection, 'Driver', '')
this.Application = ProfileString (as_inifile, as_inisection, 'Application', '')
this.Location = ProfileString (as_inifile, as_inisection, 'Location', '')
this.ConnectString = ProfileString (as_inifile, as_inisection, 'ConnectString', '')
this.UserID = ProfileString (as_inifile, as_inisection, 'UserID', '')
this.Password = ProfileString (as_inifile, as_inisection, 'Password', '')
this.Options = ProfileString (as_inifile, as_inisection, 'Options', '')
this.Trace = ProfileString (as_inifile, as_inisection, 'Trace', '')
return 1
end function
Name
|
Owner
|
systemfunctions.fileexists |
systemfunctions
|
systemfunctions.isnull |
systemfunctions
|
systemfunctions.len |
systemfunctions
|
systemfunctions.profilestring |
systemfunctions
|
systemfunctions.trim |
systemfunctions
|