When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips

Sections:
Sample Chapters
Commonly Asked Message Board Questions
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
XML Info
Information:
Feedback
Author an Article
Technology Jobs
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs

The 4 Guys Present: ASPFAQs.com

Jump to a FAQ
Enter FAQ #:
..or see our 10 Most Viewed FAQs.

4GuysFromRolla.com : ASP FAQS : Databases, General


Question:

What is adovbs.inc? Why should I use it? What benefits does it have?


[Print this FAQ]

Answer: When you connect to a database through an ASP page you are using a set of objects referred to as Active Data Object, or ADO. This library of objects contains a number of constants that can be used when specifying various properties or making various method calls for the ADO objects.

ADOVBS.inc is a file included with IIS that has all of the ADO constants defined. When revieweing ASP scripts from this Web site and other related sites, you'll find a lot of ASP scripts that, when connecting to databases, use constants with names like
adOpenForwardOnly and adLockReadOnly. These are constants that are defined in the ADOVBS.inc file and define various connection and recordset properties with English-like names.

If you want to use ADO objects and would like to have access to these constants, you will need to include ADOVBS.inc in your ASP page. To do this all you need to do is add one simple line to the top of your ASP pages:

<!--#include virtual="/adovbs.inc"-->

and be sure to put ADOVBS.inc in your root web application directory. (To learn more about #include, be sure to read: The Low-down on #include.)

You can download ADOVBS.inc from this site in streaming text format.

Here is a snippet of the contents of ADOVBS.inc

'--------------------------------------------------------------------
' Microsoft ADO
'
' (c) 1996-1998 Microsoft Corporation. All Rights Reserved.
'
'
'
' ADO constants include file for VBScript
'
'--------------------------------------------------------------------

'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3

'---- CursorOptionEnum Values ----
Const adHoldRecords = &H00000100
Const adMovePrevious = &H00000200
Const adAddNew = &H01000400
Const adDelete = &H01000800
Const adUpdate = &H01008000
Const adBookmark = &H00002000
Const adApproxPosition = &H00004000
Const adUpdateBatch = &H00010000
Const adResync = &H00020000

...

For a more in-depth look at ADOVBS.inc be sure to check out this great article: What is Adovbs.inc and Why Do I Need It?

Note that you can also automatically include ADOVBS.inc in all of the pages on your Web site
using the METADATA tag in your Global.asa file. For more information on using
the METADATA tag, be sure to read: Using METADATA to Import DLL Constants!

Happy Programming!


FAQ posted by Scott Mitchell at 1/28/2001 5:10:19 AM to the Databases, General category. This FAQ has been viewed 87,088 times.

Do you have a FAQ you'd like to suggest? Suggestions? Comments? If so, send it in! Also, if you'd like to be a FAQ Admin (creating/editing FAQs), let me know! If you are looking for other FAQs, be sure to check out the 4Guys FAQ and Commonly Asked Messageboard Questions!

Most Viewed FAQs:

1.) How can I format numbers and date/times using ASP.NET? For example, I want to format a number as a currency. (761643 views)
2.) I am using Access and getting a 80004005 error (or a [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot open the file '(unknown)' error) when trying to open a connection! How can I fix this problem? (207777 views)
3.) How can I convert a Recordset into an array? Also, how can I convert an array into a Recordset? (202549 views)
4.) How can I quickly sort a VBScript array? (196039 views)
5.) How can I find out if a record already exists in a database? If it doesn't, I want to add it. (156019 views)
6.) How do I display data on a web page using arrays instead of Do...While...MoveNext...???... (152331 views)
7.) When I get a list of all files in a directory via the FileSystemObject, they aren't ordered in any reasonable way. How can I sort the files by name? Or by size? Or by date created? Or... (140381 views)
8.) For session variables to work, must the Web visitor have cookies enabled? (110162 views)
9.) Can I send emails without using CDONTS? (107083 views)
10.) How can I take the result of a SELECT...MULTIPLE or a group of same-named checkboxes and turn it into a query? That is, if the user selects 3 answers, how can I construct a query that looks for all 3? (106308 views)
Last computed at 9/17/2007 3:22:00 AM

Software Developer / Programmer - Distributed Systems (NYC)
Next Step Systems
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume


ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article