asp下如何在Access數(shù)據(jù)庫中立即得到所插入記錄的自動編號?
更新時間:2007年04月06日 00:00:00 作者:
首先,我們要保證獲得記錄集的方式支持bookmark屬性,如在1、3插入一條有自動編號字段的記錄后,獲取該記錄的bookmark屬性值:
temp = rs.bookmark
然后再:
rs.bookmark = temp
Response.write rs.Fields("ID").Value
應(yīng)該可以了哦。
temp = rs.bookmark
然后再:
rs.bookmark = temp
Response.write rs.Fields("ID").Value
應(yīng)該可以了哦。
相關(guān)文章
IIS 錯誤 Server Application Error 詳細(xì)解決方法
IIS 錯誤 Server Application Error 詳細(xì)解決方法...2007-02-02用Command對象和RecordSet對象向數(shù)據(jù)庫增加記錄哪一個更好
用Command對象和RecordSet對象向數(shù)據(jù)庫增加記錄哪一個更好...2006-06-06后臺管理登錄篇-asp設(shè)計與數(shù)據(jù)庫
后臺管理登錄篇-asp設(shè)計與數(shù)據(jù)庫...2007-02-02