获取插入数据的id
我现在插入了一条数据,如何在插入完成后,获取该条数据的id?
[解决办法]
无人回答自己顶一下!!!
[解决办法]
'sRst-RecordSet,sCon-connection
sRst.Open "select * from tablename where id=0", sCon, adOpenKeyset,adLockOptimistic
Dim tmpJHH As Long
With sRst
.AddNew
!sname = "" '各自段赋值
......
.Update
tmpJHH = !ID '插入完成后获取id
End With