locked recordset in a single user environment

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

anonymous_at_discussions.microsoft.com
Date: 06/15/04


Date: Mon, 14 Jun 2004 20:49:29 -0700

I am having a locking problem with an entire table. I am
using Access 2002 and creating a project management app
for a lighting company. I have about 8 levels of parent
to child relationships and I have been able to make them
work but the client wants me to also create a library of
certain records that can be imported into a site/client
set.

I can create the library, I can append the records (it's
a five level append) but, when I go to edit the top table
of the append in a form the entire table locks up. If I
close the application and re-open it works fine. If I
run the update (it's all in code) without the append it's
fine. If I manually add records it's fine but once I've
appended and then try to update in code it locks.

I've removed the table as an underlying record source
from all my forms and refer to it only in code. I've
tried everything I can thing of but I still get the error.

a snipped looks like this
strsql = "SELECT tblMeasures.* " & _
"FROM tblMeasures " & _
"WHERE (((tblMeasures.Measure_id)=" & lngMeasureId & "));"

Set myrecs = CurrentDb.OpenRecordset(strsql,
dbOpenDynaset)
If myrecs.BOF And myrecs.EOF Then 'add a rec to fixtures
and go get it
    'put code here
Else
myrecs.MoveFirst
'fill in fields

'get the controls
For y = 0 To Me.Controls.Count - 1
    strControlName = Me.Controls(y).Name
        For x = 0 To myrecs.Fields.Count - 1
            If strControlName = myrecs.Fields(x).Name Then
                myrecs.Edit
                myrecs.Fields(x) = Me(strControlName)
                myrecs.Update
                Exit For
            End If
        Next x
Next y
End If

myrecs.Close

Here I am filling in unbound values from a form into the
table.

If you have any ideas please let me know. I'm way over
budget now and at my wits end.

Thanks,

Joanne



Relevant Pages

  • Re: insert
    ... Take a look at the help topic "Locking data", that's a good overview of how foxpro handles locks for several commands. ... And ther you can see that INSERT-SQL does do the same thing as APPEND BLANK: ... As foxpro works best by using buffering, INSERT INTO and infact most SQL other than SELECT-SQL is of minor use, because if it's about visually showing data for modification, controlsources of foxpros controls handle the update of fields, buffering handles the transaction of a single table BEGIN/END TRANSACTION handle the transactions with more tables and TableUpdate/Tablereverthandles the Commit or Cancellation of modifications. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Help With Trapping Lock File Errors
    ... Table and record locks should be only momentary. ... > an APPEND for instance, FoxPro locks the table only long enough to do the ... Of course you have to be careful to UNLOCK and this is where my ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Is there a way to protect a piece of critical code?
    ... Append an item to a list ... Set a Boolean indicator ... You could do it with locks as others have suggested, ... really want the Queue module. ...
    (comp.lang.python)
  • Re: Is there a way to protect a piece of critical code?
    ... Append an item to a list ... Set a Boolean indicator ... You could do it with locks as others have suggested, ... really want the Queue module. ...
    (comp.lang.python)