 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

October 2nd, 2006, 12:36 PM
|
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Why can I not update my database?
I've copied a production .mdb to a new directory to work on in a test environment. At first the test.mdb is not read-only but after I do something and I don't know what that something is, I'm causing my test.mdb to become read-only. I get the Error 3027: Cannot update. Database or object is read-only.
When I check the properties of the .mdb, right click, it is not read-only.
What am I doing to cause this situation?
|
|

October 2nd, 2006, 02:32 PM
|
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Has anyone out there experienced this problem? or Am I not giving enough info.?
Any ideas would be greatly appreciated. Thanks, FJA.
|
|

October 2nd, 2006, 02:38 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
Hi Fazzou,
It's kind of hard to tell without having direct acces to the file, but I would suspect that this may have something to do with a lock or something like that.
I would check first to see if there is a chance that anyone else has the database open, or if it had an administrative lock on when you copied it or something like that. See if there is an ldb file in the same folder, and if so, who the owner of that file is.
Next I would check the network permissions of the folder into which you copied the database.
There are probably a few more steps you could try, but as a last resort, set up a blank data base, and import all the tables, queries, forms etc into it.
Hope that helps.
Mike
Mike
EchoVue.com
|
|

October 3rd, 2006, 12:11 PM
|
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you very much Mike. Your suggestions were very helpful. But I have more questions now.
RESULT/SOLUTION:
Someone else was opening my test db. I've lived with the last resort for the past 3 days. I've created a test1, test2 and a test3, copied the db, relink to the Test DSN, renamed tables... I thought I was loosing it. I had it clearly marked so people would stay away but that's not enough. I've moved everything off of the network and into my local drive but now I risk loosing all my changes since it won't get backed-up every night. I'll think of that later.
MORE QUESTIONS, if you will please,
Is there a way I can check if other people are logged on to my test version of the database on the network without walking around and asking everyone? It's a big place.
I noticed the db version with .ldb extention appear on the network folder where the test version application resided but I thought that I was causing it to appear by opening the application.
Thank you so much for pointing that out to me since I'm usually on a network.
How do I check who the owner of the .ldb file is?
Will every user after the first user who opens the application generate one of those files?
Do the names of users just keep getting appended to the .ldb file?
Networking and servers really baffle me. I thought I understood how things worked but I don't think I do. This application will be used by multiple people at some point. Will they have to do the checking of the .ldb themselves?
I'm unclear as to what part locked me out, MS Access while I'm coding or the MS sql server during an update of a table? I think I was shut-out of both come to think of it. I was unable to update a query and I was unable to update a table at login. I thought ms sql-server handled multiple changes to the tables from multiple users. Please clarify if you can.
Thank you, FJA.
|
|

October 3rd, 2006, 02:03 PM
|
|
Authorized User
|
|
Join Date: Sep 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm sorry but I'm going to have to retract what I thought was an earlier solution.
The problem is back. I'm getting the "you can't update error" again. It happens in this form load code segment:
************************************************** ***************
Private Sub Form_Load()
On Error GoTo Err_Form_Load
Dim dbTemp As Database
Dim rcTemp As Recordset
Dim sSQL As String
DoCmd.Maximize
Me.Caption = gsAppName
'Set Security
gUser.Name = Environ$("USERNAME")
Set dbTemp = CurrentDb
sSQL = "SELECT * FROM tblLogin WHERE Username = '" & gUser.Name & "'"
Set rcTemp = dbTemp.OpenRecordset(sSQL, dbOpenDynaset, dbSeeChanges)
If rcTemp.BOF And rcTemp.EOF Then
sSQL = "INSERT INTO tblLogin ( UserName, LoginDate )SELECT '" & gUser.Name & "', Now();"
dbTemp.Execute sSQL
Else
rcTemp.MoveFirst
rcTemp.Edit <<<------------
rcTemp("LoginDate") = Now()
rcTemp.Update
End If
rcTemp.Close
Exit_Form_Load:
Exit Sub
Err_Form_Load:
MsgBox Err.Description
Resume Exit_Form_Load
End Sub
************************************************** ***************
Any thoughts would be very appreciated. Thank you, FJA.
|
|

November 16th, 2006, 11:13 AM
|
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Fazzou,
Try to ignore the ldb at the moment, or rather the contents of it. Now, when you go to the database first thing in your day, before you open the DB: is there an LDB file?
If there is then one of two things has happened:
1. Someone has gone into your DB and is still in it right now.
2. Someone (possibly even you) has gone into the DB in the past and exited using CTRL-ALT-DEL (or similar) and caused the DB is close abruptly, leaving an .ldb file behind.
There should only be one (1, single) ldb per mdb. Given the right networks circumstances, it is possible to see a userid list in the ldb, though I know this is not always the case. Try it and see, open it in Notepad and you will have rubbish or userid's.
If it is the first case and you can see the userid of the person in your db, give them a slap from me, go and grab a bit of fresh air and have a bit of a shout in the car park and then go back to your db.
Again, don't open your mdb yet... simply right click and look at the file properties, you may find it is a locked Read only file, in which case, simply untick the Read only property. I have come across this before when transferring an mdb via CD and it should only need this as the fix.
Hope you're all good now..?
Lee Hambly
|
|
 |