Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Clipper Visual-Objects > Datawindow
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 11316 of 11560
Post > Topic >>

Datawindow

by Rob van Erk <erk.v@[EMAIL PROTECTED] > Apr 15, 2008 at 11:11 AM

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
 




 7 Posts in Topic:
Datawindow
Rob van Erk <erk.v@[EM  2008-04-15 11:11:25 
Re: Datawindow
John Martens <adsl6721  2008-04-15 22:11:22 
Re: Datawindow
"Geoff Schaller"  2008-04-15 22:42:29 
Re: Datawindow
Rob van Erk <erk.v@[EM  2008-04-16 10:08:19 
Re: Datawindow
"Geoff Schaller"  2008-04-16 22:15:50 
Re: Datawindow
"Stephen Quinn"  2008-04-17 01:43:43 
Re: Datawindow
Rob van Erk <erk.v@[EM  2008-04-17 10:17:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 16:23:57 CDT 2008.