Here is my entire Insert statement. Below.
ContentID is primary_key ID and it is automaticlly created upon this insert, but want to also insert that content id in table Category column ContentId. HELP
Two table insert sort of.
Once you have defined the variable sql with your first insert, do this (assuming you use SQL Server or Access, for MySQL the syntax is different):
sql = "SET NOCOUNT ON;" & sql & ";SELECT @@IDENTITY AS LastRecId"
Set rs = db.Execute(sql)
lastRecord = rs.Fields("LastRecId")
Then you can do your next insert
sql = "INSERT INTO otherTable (fKey, somedata) values(" & lastRecord & ",'jim_was_here')"
Bookmarks