简体   繁体   English

使用SPROC从MS Access前端在SQL Server后端中插入记录

[英]Using SPROCs to insert records in SQL Server backend from MS Access frontend

I recently ran into major problems inserting records into a SQL Server backend from an MS Access frontend because I was using bound forms to do the inserts. 最近,我遇到了从MS Access前端将记录插入SQL Server后端的主要问题,因为我使用绑定表单进行插入。 Multiple commenters suggested using SQL Server stored procedures to do the inserts instead. 多个注释者建议使用SQL Server存储过程来代替插入。 How is this normally done? 通常如何做? Is there general agreement that using SPROCs is a better approach than using bound forms in this scenario? 是否普遍同意在这种情况下使用SPROC比使用绑定形式更好?

I have a few specific concerns about using SPROCs: 对于使用SPROC,我有一些特别的担忧:

  • Subforms : I can easily envision using unbound forms to do inserts via SPROCs for most tables. 表单:我可以轻松地设想使用未绑定的表单通过SPROC对大多数表进行插入。 However, I don't know how I would approach adding records for subordinate tables. 但是,我不知道如何为下级表添加记录。 Via unbound controls on the main form or a pop-up form launched from the main form? 通过主窗体上的未绑定控件还是通过主窗体启动的弹出式窗体? Either of these will be a departure from the interface my users are used to seeing. 这些都不是用户习惯于看到的界面。
  • Version Control : I have my Access applications under tight version control. 版本控制 :我的Access应用程序受到严格的版本控制。 Am I better off using pass-through queries to keep all the program logic in one place or are there other benefits to using stored procedures that are physically stored in the backend database? 我是否最好使用传递查询将所有程序逻辑都保留在一个地方,或者使用物理存储在后端数据库中的存储过程还有其他好处吗?
  • Retrofitting : Is it practical/worth doing on a large scale (ie, dozens of forms)? 改造 :大规模(即数十种形式)实用/值得吗?

Stored procedures in the database give you the benefit of reusing them outside of your Access application. 数据库中的存储过程使您可以在Access应用程序外部重用它们。

Version Control: how are you providing version control on the rest of the sql database objects? 版本控制:如何为其余sql数据库对象提供版本控制? If you can put a table under version control, you can put a proc unless all of your table create and update code is in Access. 如果可以将表置于版本控制之下,则可以放置proc,除非所有表创建和更新代码都在Access中。

I wouldn't prioritize retrofitting your forms unless there are data integrity or possibly performance concerns. 除非存在数据完整性或可能的性能问题,否则我不会优先考虑对表单进行改装。 You can do this over time or when changes/updates are taking place. 您可以随着时间的流逝或在进行更改/更新时执行此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用来自MS Access 2000的SQL-Server2005 SPROC的奇怪错误:名称中的“; 1”->找不到 - weird error using SQL-Server2005 SPROCs from MS Access 2000: “;1” in name --> not found 建立审计系统; SQL Server后端上的MS Access前端 - Building an auditing system; MS Access frontend on SQL Server backend 带有 SQL 服务器后端的 MS Access 前端 - integer 密钥超出范围 - MS Access frontend with SQL Server backend - integer key is out of range SQL Server后端,MS Access前端:连接 - SQL-Server Backend, MS Access Frontend: Connection 将后端从MS Access迁移到SQL Server - Migrating the backend from MS Access to SQL Server @@ Identity从Access Frontend(SQL Server Express后端)返回0 - @@Identity returns 0 from Access Frontend (SQL Server Express backend) 如何通过慢速连接使用“插入”将记录从SQL / Server访问中插入SQL / Server - How to insert Records to SQL/Server from Access to SQL/Server using “Insert Into” with slow connection 从 MS Access VBA 前端在 SQL 中使用 SESSION_CONTEXT - Using SESSION_CONTEXT in SQL from an MS Access VBA frontend 从 MS Access 在 SQL Server 中使用截断 - Using Truncate in SQL Server from MS Access 使用MSSQL Server从MS ACCESS数据库中选择数据记录 - SELECT data records from MS ACCESS database using MSSQL Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM