Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 24th, 2012  |  syntax: None  |  size: 0.36 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to get the auto increment primary key in old mdb database?
  2. Dim db As Database          'Test Database
  3. Dim rs As Recordset         'Test Table
  4. ...
  5. rs.AddNew
  6. id = rs!id
  7.        
  8. Using oConn As New OleDbConnection(m_ConnString)
  9.         oConn.Open()
  10.         Using cmd As New OleDbCommand(sqlInsert, oConn)
  11.             cmd.ExecuteNonQuery()
  12.         End Using
  13.     End Using