dbTalk Databases Forums  

Cannot update. Database or object is read-only

comp.database.ms-access comp.database.ms-access


Discuss Cannot update. Database or object is read-only in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Karel Koll
 
Posts: n/a

Default Cannot update. Database or object is read-only - 10-26-2003 , 12:05 AM






Hi all,
I have taken over a progam from an ex collegue.
When I convert a access'97 database to access 2000 or 2002 then I get on a
update of a query the message "cannot update. Database or object is
read-only"
The application is running well under access'97.
I have set all the rights to the user, I have import all the tables,query's
etc + hidden tables from '97 to 2000 , I have convert the database from
'97 to 2000 , but everytime I get the same message.

Can this code be the fault written in access'97 :

Option Compare Database
Option Explicit

Declare Function GetUserName Lib "Advapi32" _
Alias "GetUserNameA" (ByVal Buffer As String, _
BufferSize As Long) As Long

Function GetUser() As String
Dim UserName As String * 8
Dim Database As String * 20
Dim NameSize As Long
Dim ErrNumber As Long
NameSize = Len(UserName)
ErrNumber = GetUserName(UserName, NameSize)
GetUser = Left(UserName, NameSize)

Dim CurrentDb As Database, Currentset As Recordset
Set CurrentDb = DBEngine.Workspaces(0).Databases(0)
Set Currentset = CurrentDb.OpenRecordset("tblCurrentUserLog")
Currentset.AddNew
Currentset![ActiveUser] = UserName
Currentset![Database] = "Barcode UI"
Currentset![Date] = Now
Currentset.Update
Currentset.Close
End Function

Appreciate any help you can give.

Sincerely



Reply With Quote
  #2  
Old   
John
 
Posts: n/a

Default Re: Cannot update. Database or object is read-only - 10-28-2003 , 12:45 AM






I'm not sure what the issue is with your database exactly but in this
situation you might want to try creating a new database and then
importing all of the required tables/forms/queries from the old
database.

-John

"Karel Koll" <karelkoll (AT) planet (DOT) nl> wrote

Quote:
Hi all,
I have taken over a progam from an ex collegue.
When I convert a access'97 database to access 2000 or 2002 then I get on a
update of a query the message "cannot update. Database or object is
read-only"
The application is running well under access'97.
I have set all the rights to the user, I have import all the tables,query's
etc + hidden tables from '97 to 2000 , I have convert the database from
'97 to 2000 , but everytime I get the same message.

Can this code be the fault written in access'97 :

Option Compare Database
Option Explicit

Declare Function GetUserName Lib "Advapi32" _
Alias "GetUserNameA" (ByVal Buffer As String, _
BufferSize As Long) As Long

Function GetUser() As String
Dim UserName As String * 8
Dim Database As String * 20
Dim NameSize As Long
Dim ErrNumber As Long
NameSize = Len(UserName)
ErrNumber = GetUserName(UserName, NameSize)
GetUser = Left(UserName, NameSize)

Dim CurrentDb As Database, Currentset As Recordset
Set CurrentDb = DBEngine.Workspaces(0).Databases(0)
Set Currentset = CurrentDb.OpenRecordset("tblCurrentUserLog")
Currentset.AddNew
Currentset![ActiveUser] = UserName
Currentset![Database] = "Barcode UI"
Currentset![Date] = Now
Currentset.Update
Currentset.Close
End Function

Appreciate any help you can give.

Sincerely

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.