CRecordset - 在 Update() 之后获取自动生成的 ID

发布于 2024-07-12 23:12:32 字数 155 浏览 6 评论 0原文

刚刚在 MFC CRecordset (ODBC/Dynaset) 上调用 Update() 后,我可以做什么来提取自动生成的 ID,而无需再次访问数据库? 理想情况下,无论它是什么,都可以在 SQL Server 和 MS Access 中工作(因此查询最后一个身份可能不起作用......)

Having just called Update() on an MFC CRecordset (ODBC/Dynaset) what can I do to pull the auto-generated ID without hitting the database again? Ideally whatever it is would work in both SQL Server and MS Access (so querying for the last identity might not work...)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

源来凯始玺欢你 2024-07-19 23:12:40

做不到。 需要再次访问数据库才能提取@@Identity。 真糟糕。

Can't be done. It's necessary to hit the database a second time to pull the @@Identity. Bummer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文