locked
extract id of last inserted row RRS feed

  • Question

  • i am inserting a row in an acces table but I also want to get the id of the last inserted row so that I can use that value. Any ideas on how I can go about it?
     Dim iSql As String = "Insert into CompanyDetails (code,description)
      Connections.MyDataAdapter(iSql)
    
     Public Shared Function MyDataAdapter(ByVal iSql As String) As OleDb.OleDbDataAdapter
            Dim dt As New DataTable
            Dim da As New OleDb.OleDbDataAdapter(iSql, MyConnection)
            da.Fill(dt)
            Return da
            da.Dispose()
        End Function


    If you think it you can achieve it

    Tuesday, February 28, 2012 7:51 AM

Answers

All replies