Basically my main question is: is it possible to include a (Ado-)
Dataserver in your sub-data Window without displaying the records of
that Dataserver on the screen in first instance? This to prevent a
hugh number of SQL records being displayed before the user made a
selection of the required record on the datawindow.
Some background on the question:
I created a Datawindow with a sub-data Window. In the sub-data
Window's properties I specified an Ado server as Dataserver. The Ado
Server is a hugh SQL database and I would like users to specify first
what records they need before the contents of the sub-data Window is
filled with records. On the Datawindow a user can type (in a textbox)
his SQL statement and by pressing a pushbutton the datawindow shows
the selected records using the following code:
============================================================
Method Executebutton CLASS _DwAdoTest
Local uError AS USUAL
Local oErrbox
Begin Sequence
self:oSFSub_form1:server:newrecordset(self:oDCmSQLstatement:value)
Recover using uError
oErrbox := Errorbox{Self,"Oops, we have an error !!"}
oErrbox:Show()
End
Return
=============================================================
Method NewRecordSet(sSQLStatement) CLASS LEDEN
local oRecordset as AdoRecordSet
oRecordSet := AdoRecordSet{}
oRecordSet:Open(sSQLStatement, oConn, adOpenForwardOnly,
AdLockReadonly, AdmCmdT)
self:Recordset := oRecordset
oRecordset:close()
Return NIL
=============================================================
what I thought was to remove the Adoserver from the Sub-Form's
properties window and to change my code into the following:
============================================================
Method Executebutton CLASS _DwAdoTest
Local uError AS USUAL
Local oErrbox
Begin Sequence
self:oSFSub_form1:browser:use(LEDEN{}) <================== New
self:oSFSub_form1:server:newrecordset(self:oDCmSQLstatement:value)
Recover using uError
oErrbox := Errorbox{Self,"Oops, we have an error !!"}
oErrbox:Show()
End
Return
but... this results in an errorcode 33 [DATA TYPE ERROR] on the next
line where
self:oSFSub_form1:server:newrecordset(self:oDCmSQLstatement:value)
is specified. When I skip the
"self:oSFSub_form1:server:newrecordset...." statement from the above
code the datawindow is just filled with all records without problems.
What am I doing wrong in the above. My simple wish is to fill the
datawindow only when the user typed and specified his required
records. With that information the Recordset is defined and based on
that the datawindows should show its records.
Thks in advance for the sup****t.
Rob


|