0

I'm trying to execute this code but I get an error: "an updatable query is required for the operation".

can someone help me please?

Dim con As ADODB.Connection
Dim rs As ADODB.Recordset

Set con = New ADODB.Connection

con.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & ThisWorkbook.FullName & ";Extended Properties=""Excel 12.0 xml;HDR=YES;IMEX=1;Readonly=False"";"

Set rs = New ADODB.Recordset
Set rs = con.Execute("UPDATE [Tipo record 010$] SET tipo_record = 'NICK' WHERE numero_operazione = '999189944458'")

Set rs = Nothing
Set con = Nothing

an updatable query is required for the operation

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
NICKBEDS
  • 9
  • 3
  • Have a look at [this post](https://stackoverflow.com/questions/15709156/vba-code-to-update-create-new-record-from-excel-to-access). Should help you resolve your issue – Zac Jul 09 '19 at 15:40
  • You're trying to use ADO to update a workbook which you already have open - I'm not sure you can do that. – Tim Williams Jul 09 '19 at 16:50

0 Answers0