Problem after upsizing

M

MarcVS

I've done the upsizing of my Access database with the SSMA wizard of Access.
(Linked tables, not ADP)
This has worked well, but I've got the following problem:

On a lot of places I have this code:

Set DB = DBEngine.Workspaces(0).Databases(0)
Set MyTable = DB.OpenRecordset("Name_Of_Table", DB_OPEN_TABLE)

When I run the code, it gives me an error:

'Illegal operation' (something like that, I have a Dutch Access...)

I've changed the DB_OPEN_TABLE to DB_OPEN_SNAPSHOT. This works on some
places, but when I have:

Set DB = DBEngine.Workspaces(0).Databases(0) ' Create database
reference.
Set MyTable = DB.OpenRecordset("Name_Of_Table", DB_OPEN_SNAPSHOT) '
Create table reference.
With MyTable
.Edit
!FactuurPrint = False
.Update
End With

I get an error:

'The Operations is not available for this type of Object'

I suppose this is because a SNAPSHOT is read-Only.

Does anyone know a solution for this?

Marc
 
A

Allen Browne

Try dbOpenDynaset instead of dbOpenTable or dbOpenSnapshot.

You may also need dbSeeChanges for the next argument.
 
M

MarcVS

This also gives an error:

'Cannot update the data. The database or the object is read-only'

Marc
 
A

Allen Browne

Try opening the table directly.
Are you able to make changes there?

If not, is the database opened read-only?
Does the user have the necessary permissions?
Is the network share read-only?
 
M

MarcVS

Well, the table seems to be read-only. But it's the only table in the
database that is, all the others I can make changes in.
In SQL Manager I can change the table, so the problem seems to be in Access.
But I don't see any difference with the other tables...

Marc
 
M

MarcVS

I've found the problem. The table didn't have a PK! I've fixed this, and now
it works
(with DB_OPEN_DYNASET, dbSeeChanges)

Thank you for your help!

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top