Prev: Date converting
Next: bBrowser and combobox
From: Rob van Erk on 19 Apr 2008 05:20 The following code displays an empty bBrowser with no SQL records in the bBrowser: == CODE 1 ======================================================= METHOD bBrowserTest CLASS Standardshellwindow LOCAL odtwBrowser AS DwAdoTest LOCAL odbsServer AS AdoServer LOCAL oBrowser AS bBrowser odtwBrowser := DwAdoTest{SELF} odbsServer := LEDEN{} IF odbsServer<>NULL_OBJECT .and. odbsServer:Used odtwBrowser:Use(odbsServer) oBrowser := odtwBrowser:browser oBrowser:server:NewRecordset("SELECT * FROM LEDEN WHERE 1=0") oBrowser:Recalculate() oBrowser:Refresh() ENDIF odtwBrowser:Show() RETURN NIL == CODE 2 ====================================================== CLASS DwAdoTest INHERIT DATAWINDOW etc.. CLASS LEDEN INHERIT AdoServer etc.. == CODE 3 ====================================================== on the DwAdoTest Datawindow I have a push button with following code: METHOD executebutton CLASS DwAdoTest LOCAL uError AS USUAL LOCAL oErrbox BEGIN SEQUENCE SELF:oDCbBrowser:server:NewRecordSet(SELF:oDCmSQL:value) RECOVER USING uError oErrBox := ErrorBox{SELF, "Oops, We have an error!"} oErrBox:Show() END RETURN NIL ================================================================ The problem: when I submit a new, valid, SQL statement using the code 3 the records are perfectly displayed on the screen (for example using code 'SELECT * FROM LEDEN WHERE naam = 'Rob van Erk'), but, as soon as I click on one of the records on the screen the following error is displayed: "adErrObjectClosed, subsystem Vo2Ado Error subcode 3704". No idea why this errormessage is displayed. Still using evaluation version of bBrowser 1.4 which I downloaded from the Internet. Furthermore using VO2.7. Thks for any support that can be given.
From: Robert van der Hulst on 19 Apr 2008 07:00 Hi Rob, On Sat, 19 Apr 2008, at 02:20:59 [GMT -0700 (PDT)] (which was 11:20 where I live) you wrote about: 'VO & Ado' > BEGIN SEQUENCE > SELF:oDCbBrowser:server:NewRecordSet(SELF:oDCmSQL:value) > RECOVER USING uError > The problem: when I submit a new, valid, SQL statement using the code > 3 the records are > perfectly displayed on the screen (for example using code 'SELECT * > FROM LEDEN WHERE > naam = 'Rob van Erk'), but, as soon as I click on one of the records > on the screen the following > error is displayed: "adErrObjectClosed, subsystem Vo2Ado Error subcode > 3704". No idea why > this errormessage is displayed. Still using evaluation version of > bBrowser 1.4 which I downloaded > from the Internet. Furthermore using VO2.7. > > Thks for any support that can be given. Show us the code for NewRecordSet. This is not a standard method of Vo2Ado -- Robert van der Hulst AKA Mr. Data Vo2Jet & Vo2Ado Support VO & Vulcan.NET Development Team www.heliks.nl
From: Rob van Erk on 19 Apr 2008 09:40 Hi Robert, METHOD NewRecordSet(sSQLsrc) CLASS Leden LOCAL oRecordset as ADORecordset oRecordset := AdoRecordset{} oRecordset:Open(sSQLsrc, oConn, adOpenForwardOnly, AdlockReadOnly, AdCmdText) SELF:Recordset := oRecordset oRecordset:close RETURN NIL So, my intention is to change the recordset of an AdoServer after the user submitted his query details on the datawindow. After running the above the selected records are indeed shown on the screen but once I try to click on one of these records the problems begin. It will be some unlogic part of my code but I'am overlooking it. Thks, Rob
From: Willie Moore on 19 Apr 2008 09:56 Rob, If I am reading the code corrctly, if you remove the oRecirdset:close at the bottom of your newRecordSet method, it should work. Regards, Willie "Rob van Erk" <erk.v(a)hotmail.com> wrote in message news:da696dab-aee6-4d64-a448-b5e622857b9f(a)t54g2000hsg.googlegroups.com... > Hi Robert, > > METHOD NewRecordSet(sSQLsrc) CLASS Leden > LOCAL oRecordset as ADORecordset > > oRecordset := AdoRecordset{} > oRecordset:Open(sSQLsrc, oConn, adOpenForwardOnly, AdlockReadOnly, > AdCmdText) > > SELF:Recordset := oRecordset > > oRecordset:close > RETURN NIL > > So, my intention is to change the recordset of an AdoServer after the > user submitted his query details on the datawindow. After running the > above the selected records are indeed shown on the screen but once I > try to click on one of these records the problems begin. It will be > some unlogic > part of my code but I'am overlooking it. > > Thks, > Rob
From: E®!k /!sser on 19 Apr 2008 10:14
Rob, I never assing a recordset this way to a AdoServer. I use the SetRecordSet and that works without problems. And as Willie says, you should remove the oRecordset:Close() hth Erik "Rob van Erk" <erk.v(a)hotmail.com> schreef in bericht news:da696dab-aee6-4d64-a448-b5e622857b9f(a)t54g2000hsg.googlegroups.com... > Hi Robert, > > METHOD NewRecordSet(sSQLsrc) CLASS Leden > LOCAL oRecordset as ADORecordset > > oRecordset := AdoRecordset{} > oRecordset:Open(sSQLsrc, oConn, adOpenForwardOnly, AdlockReadOnly, > AdCmdText) > > SELF:Recordset := oRecordset > > oRecordset:close > RETURN NIL > > So, my intention is to change the recordset of an AdoServer after the > user submitted his query details on the datawindow. After running the > above the selected records are indeed shown on the screen but once I > try to click on one of these records the problems begin. It will be > some unlogic > part of my code but I'am overlooking it. > > Thks, > Rob |