How to get full permission:Add, Delete, Update, Edit in the SQL server database

accesser2003

Registered User.
Local time
Tomorrow, 01:54
Joined
Jun 2, 2007
Messages
124
I wrote the following statements to update a SQL server database:

Dim MyDb As Database
Dim MyRs As Recordset

Set MyDb = DBEngine.Workspaces(0).OpenDatabase("AMD", dbDriverPrompt, False, "ODBC;DATABASE=AMD;DSN=Remote")


Set MyRs = MyDb.OpenRecordset("SELECT AllAttendanceEvents.* FROM AllAttendanceEvents ORDER BY AllAttendanceEvents.EntryTime DESC")

MyRs.MoveFirst

While Not MyRs.EOF
MyVal = MyRs!EntryTime
Debug.Print MyVal
MyRs.Edit
MyRs!Ix = 50099
MyRs.Update
MyRs.MoveNext
Wend

When it execute the red line statement, it generates the error:Cannot update. Database or object is read-only.

This error is generated isnpite that I already checked the boxes: SELECT, INSERT, UPDATE, DELETE in the Permissions page of the tables?

Please advise.
 
Have you checked the permissions on the directory your database is in. Also the permissions on your database files?
 
Yes it is READ ONLY. However, I reset it and unchek the read only attribute in the directory:Microsoft SQL Server\MSSQL\Data.
I have a problem with my file system that when I reopen the folders, it is automatically rechecked to Read only, which leads to the problem again. Would you please help me.
 
Does your table in the SQL Server database have a Primary Key assigned? You MUST have a primary key or else it becomes read-only in Access.
 

Users who are viewing this thread

Back
Top Bottom