ADODB Error - "Cannot update. Database or object is read-only."

Paul Ked

Active Member
Joined
Jun 4, 2015
Messages
442
Hi all

I'm getting the above error on a new PC I'm setting up, it doesn't happen with the other PC's in use with the same code!

Code:
    With CreateObject("ADODB.Connection")
        .Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=K:\KKDB.accdb;"
        .Execute "INSERT INTO TestOpen (TestField) VALUES ('" & Sett.Cells(42, 2) & "') "
        .Execute "DROP TABLE Goodsbackup;"
        .Execute "SELECT * INTO GoodsBackup FROM Goods"
        .Execute "DELETE FROM Goods;"
[COLOR=#ff0000]        .Execute "INSERT INTO Goods SELECT * FROM [Excel 8.0;HDR=YES;DATABASE=" & ThisWorkbook.Name & "].[DBGoods$]"
[/COLOR]        .Close
    End With

The 'read-only' error occurs on the line in red, but everything before it executes without error.

Any ideas?

Best regards

Paul Ked
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top