G
Gibson
I am using the following code to open an external database and add a record
to a table.
strTableName = "flkpTable1"
strDBName = "C:\Program Files\Database.MDB"
Set dbImp = DBEngine.Workspaces(0).OpenDatabase(strDBName, False, True,
"")
Set rsImp = dbImp.OpenRecordset(strTableName, dbOpenDynaset)
rsImp.FindFirst "Field1 = '" & Variable1 & "'"
If rsImp.NoMatch Then
rsImp.AddNew
The code works fine until I get to the AddNew portion. I get an error
message telling me Cannot update, Database or Object is Read-Only. I don't
believe the database is read only. Is it possible to update the database?
Maybe there is something wrong with my code?
Thanks
to a table.
strTableName = "flkpTable1"
strDBName = "C:\Program Files\Database.MDB"
Set dbImp = DBEngine.Workspaces(0).OpenDatabase(strDBName, False, True,
"")
Set rsImp = dbImp.OpenRecordset(strTableName, dbOpenDynaset)
rsImp.FindFirst "Field1 = '" & Variable1 & "'"
If rsImp.NoMatch Then
rsImp.AddNew
The code works fine until I get to the AddNew portion. I get an error
message telling me Cannot update, Database or Object is Read-Only. I don't
believe the database is read only. Is it possible to update the database?
Maybe there is something wrong with my code?
Thanks