|
-
Aug 30th, 1999, 07:30 PM
#1
Thread Starter
Member
Hi guys,
I've got a very important question for me, I wrote a program in VB4 which deals with two tables in a database, this program at some point displays a form which asks the user to specify the records to be deleted (or modified) in the first table, the second form WHICH COMES AFTER displaying the first one however asks the user to specify the fields to be deleted (or modified (just the field name is modified)).
The problem is I get a "Could not lock table; currently in use" error every time I press OK in the second form. If I start the second form firstly then it goes fine!!
I thought that there was a variable that'd been still assigned to the table and that's why database engine could not do anything with the table before removing all variable referencing to that table, BUT I DID THIS and nothing happened, now my question would be something else: I use "Set Tbl = Nothing" statement to deallocate "Tbl" variable, is this enough for the database engine to consider that there's no longer any variable referring to "Tbl" object ?????????
Can I have assistance from you guys ??
I highly appreciate your participation.
poor Wesam !!
------------------
-
Aug 30th, 1999, 07:50 PM
#2
Lively Member
You haven't got a grid control, or other data aware control linked to the table in question have you? Could be the control has a recordset open, locking the table.....
Stab in the dark and all that....
-
Aug 30th, 1999, 08:08 PM
#3
Thread Starter
Member
No .. at all, I process this database manually, i.e. through references to DATABASE object, for example:
Dim DB As Database
I couldn't figure out why this message box is always appearing ??
Do you have any suggestions ??
Wesam
------------------
-
Aug 30th, 1999, 09:03 PM
#4
Frenzied Member
Post some code and we'll have a look.
-
Aug 31st, 1999, 11:12 AM
#5
Thread Starter
Member
Hi,
Unfortunately, it isn't that easy to paste the code here becuase it's a little bit complicated and you won't be able to understand how everything is going, instead give your E-mail address and I'll send you the program source code, and I can show how to produce the error and where it comes up.
Waiting for your reply,
Wesam.
------------------
-
Sep 1st, 1999, 05:12 PM
#6
Frenzied Member
Click on the envelope icon, or check my settings. I've put my address up. I am in class this week so it may be a bit before I get back.
-
Sep 2nd, 1999, 07:09 PM
#7
Lively Member
I've had this problem as well....
what I think is happening is that the first form is using the table as a recordset, and this locks the database.
In order to perform any manipulations on the table, the first form must be closed. Normally I have a second form pop up, repeating the information that they selected on the first form (through use of variables) and give the user a second chance to look through and verify the information.
Second form on load closes the first form, and populates the fields to change etc. through variables, not the table. Then when you press OK, it should work.
*****************************
For reference, when I state first form, I mean the one that is causing the locking error. From the sound of it, this is YOUR first form as well.
[This message has been edited by JohnAtWork (edited 09-03-1999).]
-
Sep 2nd, 1999, 08:05 PM
#8
Thread Starter
Member
Thank you, it was the problem .. I could figure out the cause.
Thank you guys for your help.
Happy Wesam !!
------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|