是否可以在 Access 中执行触发器,在 SqlServer 数据库的表中插入新行?
我有一个 Access 2003 数据库,想要在文件表中的新行上添加触发器,以将包含新信息的新行插入到 SqlServer 2008 数据库中的另一个表中?
这到底有可能吗?或者还有其他更好的方法/工具来实现这一点吗?我希望有一些代码片段可以开始。
感谢您的真诚帮助!
I have an Access 2003 Database and want to add a trigger upon new row in Files Table to insert a new row with new info to another table in SqlServer 2008 database?
Is this possible after all? Or are there any other better methods/tools to accomplish this? I would appreciate some code snippets to get started.
Thanks for your sincere help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MS Access 不支持触发器。但是,如果您在表单上插入/更新数据,则可以使用事件和 VBA。本文应该可以帮助您:优化 Microsoft Office Access 应用程序链接到 SQL Server
MS Access doesn't support triggers. But if you insert/update data on the form, you are able to use events and VBA. This article should help you: Optimizing Microsoft Office Access Applications Linked to SQL Server
最后,我创建了一个 Windows 服务,它将通过在最后一个 rowID 主键上保存索引来检查 Access Files 表中的新行。读取新行并将其数据发送到 Sql Server 数据库。
触发器本来是一个更好的方法,但 db 使用的是 Access 2003。该服务每天运行两次,到目前为止似乎按预期工作。
In the end I have created a windows service that will check for new rows in the Access Files table, by holding an index on the last rowID primary key. New rows are read and its data is sent to the Sql Server database.
Triggers would have been a better approach, but db is on Access 2003. The service runs twice a day and so far seems working as expected.