开发者

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

开发者 https://www.devze.com 2023-03-07 13:16 出处:网络
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.Multiple commenters suggested using SQL Serv

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. Multiple commenters suggested using SQL Server stored procedures to do the inserts instead. How is this normally done? Is there general agreement that using SPROCs is a better approach than using bound forms in this scenario?

I have a few specific concerns about using SPROCs:

  • Subforms: I can easily envision using unbound forms to do inserts via SPROCs for most tables. 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开发者_StackOverflow departure from the interface my users are used to seeing.
  • Version Control: I have my Access applications under tight version control. 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.

Version Control: how are you providing version control on the rest of the sql database objects? 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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号