
Run-Time Error 3197 - please help its driving me insane
Hi,
I have a database which is split into a program and data database. I have
written a routing in the program DB which imports data from a 3rd database
into the new data database and makes various structural changes after the
data has been appended.
In one of the several import/modification routines I have written I get the
following error message when I try to use the EDIT method of a recordset.
Run-time error 3197
The Microsoft Jet Database engine stopped the process because you and
another user are attempting to change
the same data at the same time.
The error message is totally misleading because I am the only one using the
DB's and all the DB's have been opened in exclusive mode with no problems.
In psuedo code form this is what the procedure does :
Declare some variables
Change mouse pointer to an hourglass
Creates a new querydef object giving it a name and SQL
The querydef is appended to the DB I am going to get the data from.
The new query is executed which places the data in my new backend
data db
In the new backend DB I copy data (just imported) from one field
into a new table
Using SQL I add a new temporary field to the backend data DB table I
imported the data into.
I open a recordset -
OpenRecordset("tblProduct",dbOpenTable,dbConsistent+dbSeeChanges,
dbPessimistic)
I then enter a loop (while not end of recordset)
Edit current record
Crash bang wallop the above edit line causes the run time error mentioned.
I have tried doing the following things :
1) Reboot the machine (running NT)
2) Repaired the databases
3) Closed the databases and specifically reopened them just before
opening the recordset.
4) Gone through all other code and procedures relating to importing
and made sure all recordsets and other
objects are closed and set to nothing, (even though this should
make no difference since there in different
procedures).
The reason I did (4) is because if I change the recordset to open a
different table it allows me to edit no problems, which suggests that there
is a recordset somewhere that is locking the table, or a query or something
thats still running. BUT this is the really frustrating part, I have NO
global variables, all the variables I use are local and as you
can see from the pseudo code I don't do any thing really before I open the
recordset so I really can't tell whats going wrong.
Please help.
Peter
--
Peter Row