of_Register


pfcapsrv.pbl   >   pfc_n_cst_lvsrv_datasource   >   of_Register   

Full name pfc_n_cst_lvsrv_datasource.of_Register
Access public
Extend of integer
Return value integer
Prototype public function integer of_Register(string,n_tr,string)

Name Datatype
No Data

Name Datatype
lds_control datastore
ldw_control datawindow
lpo_obj powerobject[]
ls_dwobjectname string
ls_dwsyntax string
ls_importfile string
ls_sql string
ls_Sqlerr string
ltr_obj n_tr

public function integer of_Register (string as_labelcolumn, n_tr atr_obj, string as_sql);//////////////////////////////////////////////////////////////////////////////
//	Public Function:	of_Register
//	Arguments:		as_LabelColumn		The column in the DataWindow object to display as the label. 
//						atr_obj				The transaction object to be used for the data source.
//						as_sql				The SQL Statement to be used for the data source.
//	Returns:  		integer
//	 					1 = the data source was added successfully
//						-1 = argument validation error
//						-2 = the DataWindow object did not have any key columns assigned
//						-3 = no DataWindow object was provided
//						-4 = one of the columns provided did not exist
//						-5 = SetTransObject failed for the data source
// 					-6 = Error from Cache Registration
//	Description:	Register a SQL statement as a data source for the ListView.  
//						The data source will be linked to the ListView and used to populate.
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						6.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.
//////////////////////////////////////////////////////////////////////////////
string		ls_dwobjectname
string		ls_sql
string		ls_importfile
string		ls_dwsyntax, ls_Sqlerr
powerobject lpo_obj[]
datawindow	ldw_control
datastore	lds_control
n_tr			ltr_obj

// Check transaction objects
if IsNull(atr_obj) or not IsValid(atr_obj) then return -1
if not atr_obj.of_IsConnected() then return -1

// Check sql statement
if IsNull(as_sql) or (Len(as_sql) = 0) then return -1
	
// Set null to indicate non-use
SetNull(ls_sql)
SetNull(ldw_control)
SetNull(lds_control)
SetNull(ls_importfile)

// get sql statement for object creation
ls_dwsyntax = atr_obj.SyntaxFromSQL ( as_sql, "", ls_sqlerr )	
if Len(ls_sqlerr) > 0 then return -1
		
return of_Register(as_LabelColumn, ls_dwsyntax, atr_obj, inv_Cache.SQL, &
						 as_sql, lpo_obj, ldw_control, lds_control, ls_importfile)
end function

     
Name Owner
No Data

     
Name Owner
transaction.syntaxfromsql transaction
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
systemfunctions.len systemfunctions
systemfunctions.setnull systemfunctions
pfc_n_cst_lvsrv_datasource.of_Register pfc_n_cst_lvsrv_datasource
pfc_n_tr.of_IsConnected pfc_n_tr

     
Full name
No Data

     
Name Scope
No Data