Home > Archive > Programming with dBASE > November 2006 > lockRow & toolbar problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author lockRow & toolbar problem
Mark Wood

2006-11-17, 7:12 pm

I have been experiencing a problem with lockRow() in my latest
application and I hope some of you may have some advice to offer.

Jan Holterling was good enough to help out last time i asked this
question, but so far my efforts to fix the damn thing. As I have changed
a few things since i last posted i'll briefly describe the setup.

The setup is as follows. I have a series of MDI forms used for editing
lookups and other minor data. When any of these forms has focus it sets
a property "currentform" in the _app object pointing to itself. If it
looses focus it nulls the property. Additionally the main toolbar
(attached to the framewin) has some controls on it for interacting with
this type of form (append, edit, save; that sort of thing - disabled
when the current form is not a lookup editor).

Each of the forms in question has a datamodule with database, query &
session objects, and the session object is used for each database/query
object in the datamodule. The datamodule's

The dBase tables are on a server, and the BDE alias points to them.

The toolbar's edit button simply calls the edit method on the
currentform.rowset

The datamodule contains a function that is supposed to lock the table

function rowset_canEdit
local lgcRetVal
lgcRetVal = true
if not this.lockRow()
lgcRetVal = false
msgbox("Cannot edit this record, another user is editing the
record","Cannot edit" ,BOXTYPE_OK+SYMBOL_A
LERT)
endif
return lgcRetVal

Following Jan's advice I tried the following:
Local share is on in the BDE on both machines used in my test. I have
tried using the inbuilt session instead of the session I created in the
dataModule with lockRetryCount = 1 and lockRetryInterval = 0 (and again
with lockRetryInterval = 1). Sadly to no avail.

If I include the following two lines of code in the above if statement
locking works every time. However it is not satisfactory.

else
msgbox("Editing Record")

I'd appreciate some help with the problem.

Cheers

Mark
Ken Mayer [dBVIPS]

2006-11-17, 7:12 pm

Mark Wood wrote:
> I have been experiencing a problem with lockRow() in my latest
> application and I hope some of you may have some advice to offer.
>
> Jan Holterling was good enough to help out last time i asked this
> question, but so far my efforts to fix the damn thing. As I have changed
> a few things since i last posted i'll briefly describe the setup.
>
> The setup is as follows. I have a series of MDI forms used for editing
> lookups and other minor data. When any of these forms has focus it sets
> a property "currentform" in the _app object pointing to itself. If it
> looses focus it nulls the property. Additionally the main toolbar
> (attached to the framewin) has some controls on it for interacting with
> this type of form (append, edit, save; that sort of thing - disabled
> when the current form is not a lookup editor).
>
> Each of the forms in question has a datamodule with database, query &
> session objects, and the session object is used for each database/query
> object in the datamodule. The datamodule's
>
> The dBase tables are on a server, and the BDE alias points to them.
>
> The toolbar's edit button simply calls the edit method on the
> currentform.rowset
>
> The datamodule contains a function that is supposed to lock the table
>
> function rowset_canEdit
> local lgcRetVal
> lgcRetVal = true
> if not this.lockRow()
> lgcRetVal = false
> msgbox("Cannot edit this record, another user is editing the
> record","Cannot edit" ,BOXTYPE_OK+SYMBOL_A
LERT)
> endif
> return lgcRetVal
>
> Following Jan's advice I tried the following:
> Local share is on in the BDE on both machines used in my test. I have
> tried using the inbuilt session instead of the session I created in the
> dataModule with lockRetryCount = 1 and lockRetryInterval = 0 (and again
> with lockRetryInterval = 1). Sadly to no avail.
>
> If I include the following two lines of code in the above if statement
> locking works every time. However it is not satisfactory.
>
> else
> msgbox("Editing Record")
>
> I'd appreciate some help with the problem.


Hmm. About all I can suggest is check to make sure that the data objects
in the datamodule are pointing to the correct session object, or that
you set the properties above as noted in the one contained in the
datamodule.

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/dbase/dBASEBook.htm
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com