CRecordset - 在 Update() 之后获取自动生成的 ID
刚刚在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
做不到。 需要再次访问数据库才能提取@@Identity。 真糟糕。
Can't be done. It's necessary to hit the database a second time to pull the @@Identity. Bummer.