I am using Access 2007 and have some linked tables to a mySQL database. I am using DAO to insert a record into a mySQL linked table and trying to retrieve the inserted PK using Select @@identity, but that select is returning 0.
  Dim sql As String
  Dim oDB As Database
  Set oDB = CurrentDb 
  sql = "INSERT INTO Quotes ( CustomerID ) SELECT 1 AS Expr1;" 
  oDB.Execute sql 
  If oDB.RecordsAffected <> 1 Then 
    MsgBox "cannot create new quote"
    Exit Function
  End If
  Dim rsNewID As DAO.Recordset
  Set rsNewID = oDB.OpenRecordset("SELECT @@IDENTITY")  ' Create a recordset and SELECT the new Identity
  Dim intNewID As Long
  intNewID = rsNewID(0).Value ' Store the value of the new identity in variable intNewID
  'This value is 0, why?
I've seen another question like this, that has not been satisfactorily answered for me