Hi,
I'm new to X#, but when I look at the code for ADSSQLServer in X#, the last parameter in the init method and the refresh method to update the select with a changed parameter are missing.
X#-Contructor:
CONSTRUCTOR( oFile, lShareMode, lReadOnlyMode, xDriver, aRDD ) CLIPPER
LOCAL cTemp AS STRING
LOCAL cFileName AS STRING
// Set the query text, this is necessary because the VO runtime doesn't like
// some of the special characters that are used in SQL queries
RddInfo( _SET_SQL_QUERY, oFile )
// Some VO libraries have trouble with the alias as is. So for the SQL RDDS,
// just grab the first word of the SQL query and use it as the alias. The VO
// runtime will adjust it to be unique if there is a naming conflict.
cTemp := Left( oFile, At( " ", oFile ) - 1 )
// Call the DBServer init method which will execute the query
SUPER( cTemp, lShareMode, lReadOnlyMode, xDriver, aRDD )
......
and now the VO-Init:
METHOD Init ( oFile, lShareMode, lReadOnlyMode, xDriver, aRdd, params ) CLASS AdsSQLServer
LOCAL cTemp AS STRING
LOCAL cFileName AS STRING
// Set the query text, this is necessary because the VO runtime doesn't like
// some of the special characters that are used in SQL queries
RDDINFO( _SET_SQL_QUERY, oFile )
// Pass the parameter array into the RDD
// The params argument should be an array of parameters for the query.
// The array should be an array of parameter names and parameter values.
// For example:
// {{ "lastname", "Smith" }, { "ID", 25 }}
IF ( IsNil( params ) )
// Pass in an empty array. Passing in NIL doesn't get to the RDD.
RDDINFO( _SET_SQL_PARAMETERS, {} )
ELSE
RDDINFO( _SET_SQL_PARAMETERS, params )
ENDIF
// Some VO libraries have trouble with the alias as is. So for the SQL RDDS,
// just grab the first word of the SQL query and use it as the alias. The VO
// runtime will adjust it to be unique if there is a naming conflict.
cTemp := Left( oFile, At( " ", oFile ) - 1 )
// Call the DBServer init method which will execute the query
SUPER:Init( cTemp, lShareMode, lReadOnlyMode, xDriver, aRdd )
.....
and the Refresh-Method from VO:
METHOD Refresh ( params ) CLASS AdsSQLServer
// This version of Refresh() accepts an array of SQL parameters
// for the query. The array should be an array of parameter names and
// parameter values. For example:
// {{ "lastname", "Smith" }, { "ID", 25 }}
// Set the parameters if provided.
IF params != NIL
SELF:RDDINFO( _SET_SQL_PARAMETERS, params )
ENDIF
RETURN SUPER:Refresh()
HTH
Gerhard