Access 2016 Runtime error 3167 when calling Edit on a Recordset, but only with an Umlaut in the data

64 Views Asked by At

I have to maintain some legacy database system that uses MS Access 2016 as a frontend. The data is stored in a PostgreSQL database and connection is made with psqlODBC.

There is a form, from where I can select some dataset, make some edits and save it back. This is where the trouble starts.

The table looks like this

  • projectnumber (Primary key) name
  • group (Primary key) name
  • cost numeric

The relevant code looks like this

        Dim rs As Recordset
        Dim dbs As Database
        Set dbs = CurrentDb
        Set rs = dbs.OpenRecordset("public_SomeTable", dbOpenDynaset)
        rs.FindFirst ("[projectnumber] = '" & projektnumber & "'" & " And [group] ='" & group & "'")
        rs.Edit
        rs!cost = cost
        rs.Update
        rs.Close

This seems to work fine, unless group contains an Umlaut, i.e. Motorhead works fine, but Motörhead does not. In that case, I get runtime error 3167: Record deleted. Which is confusing, as the record still exists

0

There are 0 best solutions below