Prev: Date converting
Next: bBrowser and combobox
From: Geoff Schaller on 19 Apr 2008 21:17 Rob, You've heard the most obvious answer from Willie and Erik but WHY are you using a forward only cursor???? <g> That is your next problem. With a browser you must use a static client side cursor. Geoff "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: jorgeaccinelli on 20 Apr 2008 06:24 On 19 abr, 22:17, "Geoff Schaller" <geo...(a)softwareobjectivesx.com.au> wrote: > Rob, > > You've heard the most obvious answer from Willie and Erik but WHY are > you using a forward only cursor???? <g> > > That is your next problem. With a browser you must use a static client > side cursor. > > Geoff > > "Rob van Erk" <er...(a)hotmail.com> wrote in messagenews: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- Ocultar texto de la cita - > > - Mostrar texto de la cita - Hello I have a question about the cursor static, client side, a kind of "photo" of the data. the parameter AdlockReadOnly is right? Why lock in read-only mode? Greetings Jorge Accinelli
From: Lars Broberg on 20 Apr 2008 09:45 Jorge, adLockReadOnly means your recordset will be readonly (ie no update possible and no update locks will be held in the database). This is a good thing if you do your updates through AdoCommand via stored procedures (and/or UPDATE statements) and, of course, if you don't plan to do any updates at all. ---- Lars Broberg Elbe-Data AB lars at elbe-data dot se jorgeaccinelli(a)dextrasistemas.com.ar wrote: > On 19 abr, 22:17, "Geoff Schaller" <geo...(a)softwareobjectivesx.com.au> > wrote: >> Rob, >> >> You've heard the most obvious answer from Willie and Erik but WHY are >> you using a forward only cursor???? <g> >> >> That is your next problem. With a browser you must use a static client >> side cursor. >> >> Geoff >> >> "Rob van Erk" <er...(a)hotmail.com> wrote in messagenews: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- Ocultar texto de la cita - >> - Mostrar texto de la cita - > > Hello > > > I have a question about the cursor static, client side, > a kind of "photo" of the data. > the parameter AdlockReadOnly is right? > Why lock in read-only mode? > > Greetings > Jorge Accinelli
From: jorgeaccinelli on 20 Apr 2008 11:11 On 20 abr, 10:45, Lars Broberg <this.is.not.a.va...(a)dress.se> wrote: > Jorge, > adLockReadOnly means your recordset will be readonly (ie no update > possible and no update locks will be held in the database). > This is a good thing if you do your updates through AdoCommand via > stored procedures (and/or UPDATE statements) and, of course, if you > don't plan to do any updates at all. > ---- > Lars Broberg > Elbe-Data AB > lars at elbe-data dot se > > > > jorgeaccine...(a)dextrasistemas.com.ar wrote: > > On 19 abr, 22:17, "Geoff Schaller" <geo...(a)softwareobjectivesx.com.au> > > wrote: > >> Rob, > > >> You've heard the most obvious answer from Willie and Erik but WHY are > >> you using a forward only cursor???? <g> > > >> That is your next problem. With a browser you must use a static client > >> side cursor. > > >> Geoff > > >> "Rob van Erk" <er...(a)hotmail.com> wrote in messagenews: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- Ocultar texto de la cita - > >> - Mostrar texto de la cita - > > > Hello > > > I have a question about the cursor static, client side, > > a kind of "photo" of the data. > > the parameter AdlockReadOnly is right? > > Why lock in read-only mode? > > > Greetings > > Jorge Accinelli- Ocultar texto de la cita - > > - Mostrar texto de la cita - OK Finally ... MY RECORDET is in read-only mode, but another user can take the same recorset in mode Read- write and change things? When I update the Database should I take precautions If this has happened? I guess the answer, But I am planning to move from DBF to Sql I would like to know your opinion Thanks Jorge Accinelli Buenos Aires - Argentina
From: Lars Broberg on 20 Apr 2008 11:54
Jorge, > Finally ... > MY RECORDET is in read-only mode, but another > user can take the same recorset in mode > Read- write and change things? When I update the > Database should I take precautions > If this has happened? I guess the answer, > But I am planning to move from DBF to Sql > I would like to know your opinion > Thanks Well, there are no locks held and no "connection" to the database (if you have a clientside cursor) so you have no idea what's happening there <g>. But the locking strategies in SQL really isn't any different from DBF, but you have the option to do the updates/inserts/deletes in a couple of different ways: - Via ADO (obviously not with ReadOnly recordsets) - Via your own "UPDATE/DELETE/INSERT" code executing via AdoCommand - Via your own Stored Procedures (for UPDATE/DELETE/INSERT) In the first case ADO can handle the lockings if you have a primary key in the table and you use for example adLockOptimistic. I wouldn't use this other than for very simple updates on simple tables. In the two other cases you have to have some way of "knowing" if some other user have changed the record before "you". The term "record" here can mean information from more than one table. You normally use datetime fields for this or the SQL Server Timestamp data type. Some info about the Timestamp data type: http://msdn2.microsoft.com/en-us/library/ms182776.aspx Hope this helps in some way... ---- Lars Broberg Elbe-Data AB lars at elbe-data dot se |