Home Database Mysql Tutorial 在Access中使用“存储过程”

在Access中使用“存储过程”

Jun 07, 2016 pm 04:02 PM
access asp use stored procedure us pass

我们已经熟悉在 ASP 中通过调用 SQL Server 存储过程来执行数据库操作 不过大家是否知道 在桌面级数据库 Access 中 我们也能够创建并使用 存储过程 ? Access + ASP 是开发轻量级 Web 应用程序的绝佳组合 简单 快速 兼容性好 但是性能通常不高 并且 用 ADODB

  我们已经熟悉在 ASP 中通过调用 SQL Server 存储过程来执行数据库操作不过大家是否知道在桌面级数据库 Access 中我们也能够创建并使用存储过程
Access + ASP 是开发轻量级 Web 应用程序的绝佳组合简单快速兼容性好但是性能通常不高并且用 ADODBConnection 和 Recordset 对象来执行 SQL 语句的方式也有一些不方便因为带参数的 SQL 语句的参数值也常常是拼接到字符串中于是便有了诸如单引号问题这样的麻烦使用存储过程的一个好处就是支持 SQL 语句参数值的另外提供

  事实上Access( 及以上版本)中所谓存储过程和 SQL Server 中的 Stored Procedure 是不能比的它只能算是Stored Procedure Lite不支持多条 SQL 语句不支持逻辑语句(呵呵毕竟不是 TSQL)等等我也还不清楚它是不是预编译了不过正如同 VBScript 实现的所谓仅仅具有封装性对于代码结构的美化和程序重用性具有很大促进一样Access 的轻量存储过程对于规范小出错几率的数据库操作应该也有帮助并且性能可能会有提高

  下面我译 step by step 的方式介绍如何在 Access 中创建存储过程然后在 ASP 程序中使用它

  (一)在 Access 中创建存储过程

  不知道大家的 Access 应用水平如何反正它对于我来说仅仅就是一个 MDB 数据库文件的创建工具我只会新建 MDB 文件然后在 Access 的界面中创建表索引约束等等over~

  Access 中的查询就扮演了存储过程的角色下文中我提到的 Access 的存储过程或者查询都是指这个东西

  对于查询的创建Access 提供了一个傻瓜工具类似 VSNET 里边建立 DataAdapter 时的向导不过我喜欢直接写 SQL 代码

  好下面先看看我们这个简单的例子中所使用的数据库的表结构

  
在Access中使用“存储过程”

  然后在 Access 主界面上点击左侧的查询按钮再在右边双击在设计视图中创建查询以打开查询设计视图

  
在Access中使用“存储过程”

  这时弹出的是可视化的查询生成器我们首先添加 SQL 语句需要涉及的表

  
在Access中使用“存储过程”

  添加表之后在设计视图上点击鼠标右键选择SQL 视图以切换到 SQL 代码编辑窗口

  
在Access中使用“存储过程”

  好下面说说 Access 的存储过程的特点

  Access 的查询我目前的感觉是对 SQL 语句的一个包装或许进行了某种优化如预编译我们不能像写 SQL Server 存储过程那样使用多重操作事务逻辑判断循环等等……

  

  本新闻共当前在第页        

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to disable background applications in Windows 11_Windows 11 tutorial to disable background applications How to disable background applications in Windows 11_Windows 11 tutorial to disable background applications May 07, 2024 pm 04:20 PM

1. Open settings in Windows 11. You can use Win+I shortcut or any other method. 2. Go to the Apps section and click Apps & Features. 3. Find the application you want to prevent from running in the background. Click the three-dot button and select Advanced Options. 4. Find the [Background Application Permissions] section and select the desired value. By default, Windows 11 sets power optimization mode. It allows Windows to manage how applications work in the background. For example, once you enable battery saver mode to preserve battery, the system will automatically close all apps. 5. Select [Never] to prevent the application from running in the background. Please note that if you notice that the program is not sending you notifications, failing to update data, etc., you can

How to convert deepseek pdf How to convert deepseek pdf Feb 19, 2025 pm 05:24 PM

DeepSeek cannot convert files directly to PDF. Depending on the file type, you can use different methods: Common documents (Word, Excel, PowerPoint): Use Microsoft Office, LibreOffice and other software to export as PDF. Image: Save as PDF using image viewer or image processing software. Web pages: Use the browser's "Print into PDF" function or the dedicated web page to PDF tool. Uncommon formats: Find the right converter and convert it to PDF. It is crucial to choose the right tools and develop a plan based on the actual situation.

What does dao mean in java What does dao mean in java Apr 21, 2024 am 02:08 AM

DAO (Data Access Object) in Java is used to separate application code and persistence layer, its advantages include: Separation: Independent from application logic, making it easier to modify it. Encapsulation: Hide database access details and simplify interaction with the database. Scalability: Easily expandable to support new databases or persistence technologies. With DAOs, applications can call methods to perform database operations such as create, read, update, and delete entities without directly dealing with database details.

BTCC tutorial: How to bind and use MetaMask wallet on BTCC exchange? BTCC tutorial: How to bind and use MetaMask wallet on BTCC exchange? Apr 26, 2024 am 09:40 AM

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

Can't allow access to camera and microphone in iPhone Can't allow access to camera and microphone in iPhone Apr 23, 2024 am 11:13 AM

Are you getting "Unable to allow access to camera and microphone" when trying to use the app? Typically, you grant camera and microphone permissions to specific people on a need-to-provide basis. However, if you deny permission, the camera and microphone will not work and will display this error message instead. Solving this problem is very basic and you can do it in a minute or two. Fix 1 – Provide Camera, Microphone Permissions You can provide the necessary camera and microphone permissions directly in settings. Step 1 – Go to the Settings tab. Step 2 – Open the Privacy & Security panel. Step 3 – Turn on the “Camera” permission there. Step 4 – Inside, you will find a list of apps that have requested permission for your phone’s camera. Step 5 – Open the “Camera” of the specified app

What does field mean in java What does field mean in java Apr 25, 2024 pm 10:18 PM

In Java, a "field" is a data member in a class or interface that is used to store data or state. The properties of field include: type (can be any Java data type), access rights, static (belongs to a class rather than an instance), final (immutable) and transient (not serialized). Field is used to store state information of a class or interface, such as storing object data and maintaining object state.

How does the Java reflection mechanism modify the behavior of a class? How does the Java reflection mechanism modify the behavior of a class? May 03, 2024 pm 06:15 PM

The Java reflection mechanism allows programs to dynamically modify the behavior of classes without modifying the source code. By operating the Class object, you can create instances through newInstance(), modify private field values, call private methods, etc. Reflection should be used with caution, however, as it can cause unexpected behavior and security issues, and has a performance overhead.

How to cross-domain iframe in vue How to cross-domain iframe in vue May 02, 2024 pm 10:48 PM

Ways to solve iframe cross-domain issues in Vue: CORS: Enable CORS support in the backend server and use XMLHttpRequest or fetch API to send CORS requests in Vue. JSONP: Dynamically load JSONP scripts in Vue using the JSONP endpoint in the backend server. Proxy server: Set up a proxy server to forward requests, use a third-party library (such as axios) in Vue to send requests and set the proxy server URL.

See all articles