C
Chris Coghlan
I was wondering if you are able to use the AddNew Update and Delete commands
for a recordset using ODBC. My application keeps giving me a run-time
error. Cannot update. Database or object is read only. Below is a sample
of code I am using.
Set ws = CreateWorkspace("ASQL", "sa", "password", dbUseODBC)
Set db = ws.OpenDatabase("ASQL", , , "ODBC;DSN=ASQL")
Set rst = db.OpenRecordset("tbl_Company_Notes", dbOpenDynaset)
With rst
rst.AddNew
rst!Company_Id = Me.Company_Id
rst!EntryDate = Format(Date, "dd mmm yyyy")
rst!CompanyNotes = "Company was created in database by " & CurrentUser
& " on " & Format(Date, "dd mmm yyyy")
rst!UserName = CurrentUser
rst!Last_Update = Now()
rst.Update dbSeeChanges
End With
rst.Close
db.Close
Any help would be great.
Chris
for a recordset using ODBC. My application keeps giving me a run-time
error. Cannot update. Database or object is read only. Below is a sample
of code I am using.
Set ws = CreateWorkspace("ASQL", "sa", "password", dbUseODBC)
Set db = ws.OpenDatabase("ASQL", , , "ODBC;DSN=ASQL")
Set rst = db.OpenRecordset("tbl_Company_Notes", dbOpenDynaset)
With rst
rst.AddNew
rst!Company_Id = Me.Company_Id
rst!EntryDate = Format(Date, "dd mmm yyyy")
rst!CompanyNotes = "Company was created in database by " & CurrentUser
& " on " & Format(Date, "dd mmm yyyy")
rst!UserName = CurrentUser
rst!Last_Update = Now()
rst.Update dbSeeChanges
End With
rst.Close
db.Close
Any help would be great.
Chris