如何在MS Access中制作存储过程? [英] How do I make a stored procedure in MS Access?

查看:68
本文介绍了如何在MS Access中制作存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在MS Access中制作存储过程?

How do I make a stored procedure in MS Access?

推荐答案

Access 2010既有存储过程,也有表触发器.而且,即使您不使用服务器,这两个功能都可用(因此,在基于100%文件的模式下).

Access 2010 has both stored procedures, and also has table triggers. And, both features are available even when you not using a server (so, in 100% file based mode).

如果您将SQL Server与Access一起使用,则存储过程当然是使用SQL Server而非Access构建的.

If you using SQL Server with Access, then of course the stored procedures are built using SQL Server and not Access.

对于Access 2010,打开表(非设计视图),然后选择表选项卡.您在此处看到用于创建存储过程和表触发器的选项.

For Access 2010, you open up the table (non-design view), and then choose the table tab. You see options there to create store procedures and table triggers.

例如:

请注意,存储过程语言具有自己的风格,就像Oracle或SQL Server(T-SQL)一样.这是由于水果订单表中的更新而更新水果库存的示例代码

Note that the stored procedure language is its own flavor just like Oracle or SQL Server (T-SQL). Here is example code to update an inventory of fruits as a result of an update in the fruit order table

请记住,这些都是真正的引擎级表触发器.实际上,如果您使用VB6,VB.NET,FoxPro打开该表,或者甚至在未安装Access的计算机上修改该表,则将执行表级的过程代码和触发器.因此,这是Access 2010数据引擎射流(现在称为ACE)的新功能.如上所述,这是运行的过程代码,而不仅仅是一条语句.

Keep in mind these are true engine-level table triggers. In fact if you open up that table with VB6, VB.NET, FoxPro or even modify the table on a computer WITHOUT Access having been installed, the procedural code and the trigger at the table level will execute. So, this is a new feature of the data engine jet (now called ACE) for Access 2010. As noted, this is procedural code that runs, not just a single statement.

这篇关于如何在MS Access中制作存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆