ASP 3.0 声明不包含 ADOVBS.inc 的 ADO 常量 [英] ASP 3.0 Declare ADO Constants w/out Including ADOVBS.inc

查看:19
本文介绍了ASP 3.0 声明不包含 ADOVBS.inc 的 ADO 常量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ASP3.0/VBScript 编写了一个简单的表单处理程序脚本,并希望将输入的数据(通过 Web)添加到位于我服务器上的 Access 数据库中.我正在使用 OLEDB 方法进行连接,如下所示:

I've written a simple form handler script using ASP3.0/VBScript and would like to add the inputted data (via the web) to an Access database located on my server. I'm using the OLEDB method to connect like so:

Cst = "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"DATA SOURCE=" & Server.MapPath("DataBase.mdb")

Dim Conn
Set Conn = CreateObject("ADODB.Connection")
Conn.Mode = 3

Conn.Open Cst

Blah Blah Blah...

我目前在顶部包含一个名为 ADOVBS.inc 的文件,但我想放弃它,因为我觉得它效率低下且浪费.我想根据需要定义常量 - 但我不知道如何.我需要定义哪些 ADO 常量以及在哪里定义?我正在使用的书基本上说忘记那一磅 - 包括那 400 左右的鼻屎,不要问愚蠢的问题!"

I currently have a file named ADOVBS.inc included at the top but would like to ditch it because I feel it's inefficient and wasteful. I'd like to define the constants as I need them- but I don't know how. What ADO constants would I need to define and where? The book that I'm using basically says "forget about that- pound include those 400 or so boogers in there and don't ask stupid questions!"

任何具体的例子/帮助将不胜感激.

Any specific examples/help would be greatly appreciated.

谢谢,

推荐答案

您有几个选项可供选择.您可以使用

you have a couple of options to choose from. You can reference the metadata library in your page ( or in your global.asa file ) with

<!--
   METADATA    
   TYPE="TypeLib"    
   NAME="Microsoft ActiveX Data Objects 2.5 Library"    
   UUID="{00000205-0000-0010-8000-00AA006D2EA4}"    
   VERSION="2.5"
-->

您可以简单地将adovbs 文件中的一些常量复制到您的页面中以满足您的需要.例如

you can simply copy a few constants from the adovbs file into your page to cover your needs. For example

Const adCmdText = 1      'Evaluate as a textual definition    
Const adCmdStoredProc = 4 'Evaluate as a stored procedure

这篇关于ASP 3.0 声明不包含 ADOVBS.inc 的 ADO 常量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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