Error 3211

stav81

New member
Local time
Today, 08:09
Joined
Dec 5, 2007
Messages
2
Hello everyone,


I have written some code that will add some entries to a table:

Set myTable1 = db.TableDefs("Weekly_Card")
Set rst1 = myTable1.OpenRecordset(dbOpenDynaset, dbOptimistic)

While i < arrayCounter
With rst1
.AddNew
![ProjectID] = projectNames(i)
![MemberID] = usrName
![WeekNo] = noWeek
.Update
End With
i = i + 1
Wend

The problem is that when i am trying to execute this code a form is already open that is bound to the table and so i get the followng error:

"3211" Runtime error
"The Database engine could not lock table "Weekly Card" because its already in use by another person or process"

Now my questions are:
Is there a way to access the table and add data to it whilst it is being used ?
Is there a way around this problem?

I am using Microsoft Office access 2003.
Thanks in advance

--Stav.
 
yea you can clone the recordset and try it that way.

Dim rs As Recordset
Set rs = Me.RecordsetClone
 
yea you can clone the recordset and try it that way.

Dim rs As Recordset
Set rs = Me.RecordsetClone

If you use things like this:

Dim rs As Recordset

Make sure to explicitly define it:

Dim rs As DAO.Recordset

(or if using ADO, Dim rs As ADO.Recordset)
 
If you use things like this:

Dim rs As Recordset

Make sure to explicitly define it:

Dim rs As DAO.Recordset

(or if using ADO, Dim rs As ADO.Recordset)

im new to these, so why define it explicitly? and what is 2003 using? dao? or ado? and whats the difference?
 
yea you can clone the recordset and try it that way.

Dim rs As Recordset
Set rs = Me.RecordsetClone

Hi,
Thanks for the reply.


How will this work exactly? I am new to access so everything is a bit confusing at the moment. I did some readign on the recordsetclone command and i am a bit confused.

Some more explaining on the problem i have:
The application that i have written is meant to be used by several users. The problem i am having is that when a user is loggen on the "TimeTracker" the interface that he/she is presented with is bound to a table called "Weekly Card". Now when another user logs in for the first time in any given week i retrieve some data behind the scenes and i want to add them data to the "Weekly Card" table that as i mentioned above is already bound by a different user, hence getting the error.

How will i use cloning i this scenario?

Thanks,

--Stav.
 

Users who are viewing this thread

Back
Top Bottom