Tag: lastinsertid

VBA如何find最后一个插入ID?

我有这个代码: With shtControleblad Dim strsql_basis As String strsql_basis = "INSERT INTO is_calculatie (offerte_id) VALUES ('" & Sheets("controleblad").Range("D1").Value & "')" rs.Open strsql_basis, oConn, adOpenDynamic, adLockOptimistic Dim last_id As String last_id = "select last_insert_id()" End With stringlast_id没有被填充。 哪里不对? 我需要find的last_insert_id,所以我可以在另一个查询中使用它。