Murugan Kannan
May 4th, 2001, 10:48 AM
I am experiencing a weird problem.
I am accessing (add/edit) 2 tables in a SQL server database (Using DAO). But one of the tables
is not letting me to do that. I am getting an error message "Can't update. Database or object is read-only." and the "Updatable" property of the recordset is "False".
When I ask my DBA, he assures me that I have the same permission for every table. Am I missing something?
Here is the sample code.
Any help would be appreciated.
Thanks.
- MK
Private Sub Command2_Click()
Dim appws As Workspace
Dim appdb As Database
Dim rs As Recordset
Dim sql As String
On Error GoTo yuck
Set appws = DBEngine.Workspaces(0)
Set appdb = appws.OpenDatabase("", False, False, "") 'dsn string has valid value
sql = "SELECT * from TableA"
Set rs = appdb.OpenRecordset(sql, dbOpenDynaset, dbSeeChanges)
rs.AddNew
yuck:
rs.Close
appdb.Close
appws.Close
If Err.Number > 0 Then MsgBox Err.Description
End Sub
I am accessing (add/edit) 2 tables in a SQL server database (Using DAO). But one of the tables
is not letting me to do that. I am getting an error message "Can't update. Database or object is read-only." and the "Updatable" property of the recordset is "False".
When I ask my DBA, he assures me that I have the same permission for every table. Am I missing something?
Here is the sample code.
Any help would be appreciated.
Thanks.
- MK
Private Sub Command2_Click()
Dim appws As Workspace
Dim appdb As Database
Dim rs As Recordset
Dim sql As String
On Error GoTo yuck
Set appws = DBEngine.Workspaces(0)
Set appdb = appws.OpenDatabase("", False, False, "") 'dsn string has valid value
sql = "SELECT * from TableA"
Set rs = appdb.OpenRecordset(sql, dbOpenDynaset, dbSeeChanges)
rs.AddNew
yuck:
rs.Close
appdb.Close
appws.Close
If Err.Number > 0 Then MsgBox Err.Description
End Sub