Database Locked error

RAHUL

New member
Local time
Today, 05:37
Joined
Oct 1, 2004
Messages
5
Hi all
I am new to access programming..
I have some problem with my database. while inserting data it throws error
that 'database is locked by the admin on machine --'
.I am not getting why this is happening. Because sometimes the data is inserted .
and other issue is that while taking the value of any textfield. It say's that focus is not set to that textfield..
is it necessary to set focus every time..i am using only one form and tab control in it.

So, Can anybody help me?
:mad:
 
while inserting data it throws error 'database is locked by the admin on machine --'

The first question is, are YOU the admin on the named machine?

If not, then the message might be literally true. Talk to the admin.

If YOU are the admin and that named machine is the same machine you are on, then the problem might be that you are attempting to add data to a recordset underneath a form bound to the same recordset. You are therefore blocking yourself. More precisely, the two recordsets, one of which is implied by its connection through the form, block each other.

The solution is usually to save the record bound to the form before attempting to update the recordset through code. Or don't use a bound form to do this. (Though admittedly using an unbound form is harder for a novice 'cause of all the recordset tricks you have to play on yourself.)

is it necessary to set focus every time

Focus is automatic for mouse/tab operations, so you must be doing something with VBA underneath the form. Whatever you are doing, you are attempting to reset something not in focus at the time you are tweaking it. But normally, you do NOT have to have the focus on a specific field. It just has to be somewhere legal. You can randomly access controls if you wish.

Because sometimes the data is inserted .

Likely that it has to do with exactly where in the recordset buffer the new record (being insert) and old record (visible through the form) are located. If they are in the same buffer, you find that the old record, being the center of attention of a write-enabled form, is open and therefore locked. The new record cannot go into the same buffer. But if, by luck, the new record and the old record would be in different buffers, you can get away with it. Which tells me that you don't have table-level locking on, 'cause if you did, you would NEVER be able to add a new record. You MIGHT have record-level locking on, which is really buffer-level locking. (Bill Gates lied when he called it record-level locking.)
 
databse unlocked

Thanks ,
nice explanation for the query.You are right that i am using unbound form . I am doing all operations through coding.
so how to cancel the recordset bounding to form.
i am not setting recordsource property of the form.

Can tell me more abt how to do unbound coding?
 

Users who are viewing this thread

Back
Top Bottom