
Dynaset not Updatable (SQL Server)
I'm trying to use the Recordset.AddNew method against a SQL Server
database, and getting run time error 3027: "Can't update. Database or
object is read-only."
If I use the Database.Execute method, I can do the insert, so that should
mean I have the appropriate rights in the database. If I run the code
against an Access database, both the Execute and AddNew methods work.
My theory is that it's something in the way I'm calling OpenDatabase. Do
you know where I would look to find the options in the connection string?
Or is it something unrelated to that?
Thanks in advance for any insights.
----------------------------------------------------
Here's the code:
Dim DYN As Recordset
Dim stConnect As String
Dim db As Database
stConnect = "ODBC;Uid=sa;PWD=;DSN=testvb;DBQ=ebc_db;LOGINTIMEOUT=180"
Set db = OpenDatabase("", False, False, stConnect)
' This Execute works fine.
db.Execute "insert into TestVB (TestText, TestInt) values (""def"", 6)"
Set DYN = db.OpenRecordset("TestVB", dbOpenDynaset)
'====== DYN.Updatable is now FALSE, leading to the error on the following
line. =========
DYN.AddNew
-- David Thureson
-- Workflow Solutions