Use "Stored Procedure" in Access (1)

Source: Internet
Author: User
Tags mdb database
We are already familiar with using SQL Server (a powerful database platform on WINDOWS) stored procedures in ASP to perform database operations, but do you know that in table-level database Access, can we also create and use stored procedures "? Access + ASP is an excellent combination of lightweight Web applications: simple

We are already familiar with using ASP to execute database operations by calling the stored procedures of SQL server (a powerful database platform on WINDOWS). However, do you know that in table-level database Access, can we also create and use stored procedures "? Access + ASP is an excellent combination of lightweight Web applications: simple

We are already familiar with SQL server calling in ASP (a powerful database platform on WINDOWS) Storage ProcessBut do you know that in table-level database Access, we can also create and Use" Storage Process"?

Access + ASP is an excellent combination of lightweight Web applications: simple, fast, and compatible, but the performance is usually not high. In addition, ADODB is used. connection and Recordset objects are also inconvenient to execute SQL statements, because the parameter values of SQL statements with parameters are often spliced into strings, as a result, there is such a problem as "single quotes. Use Storage ProcessOne benefit is that the SQL statement parameter values are supported.

In fact, in Access (2000 and later versions), Storage Process", Which is incomparable to Stored Procedure in SQL server (a powerful database platform on WINDOWS. It can only be regarded as "Stored Procedure Lite", does not support multiple SQL statements, does not support logical statements (huh, after all, not a T-SQL) and so on, I do not know whether it is pre-compiled. However, just as the so-called "class" implemented by VBScript is only encapsulation, the "beautification" of the code structure and the reusability of the program are greatly promoted, the "lightweight" Access Storage Process", Database operations with a low probability of errors should also be helpful, and the performance may be improved.

The following describes how to create Storage ProcessAnd then in the ASP program UseIt.

   (1) Create"StorageProcess"

I don't know what the Access application level is. For me, it is just a tool for creating MDB database files. I will only create MDB files, create tables, indexes, and constraints on the Access interface ~

The "query" in Access is assumed Storage Process. The Access Storage Process"Or" query "refers to this item.

For the creation of "query", Access provides a dumb tool, similar to the wizard used to create a DataAdapter in VS. NET. However, I like to write SQL code directly.

Well, let's take a look at our simple example. UseThe table structure of the database.


Click "query" on the left of the Access interface, and then double-click "create query in design view" on the right to open the query design view.


12 3 next page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.