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

Sample Chapters
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Stump the SQL Guru!
XML Info
Author an Article

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


What databases can ASP work with? How do technologies like ADO, OLE-DB, and ODBC fit in?

[Print this FAQ]

Answer: This question is a bit misleading - when querying, inserting, updating, or deleting information from a database through an ASP page, ASP is not what is, directly, working with the database. Rather, ASP is utilizing a set of COM objects referred to as Active Data Objects, or ADO for short. These objects were designed to connect to a wide array of data sources. Furthermore, since these objects are COM objects, they can be accessed from any programming technology that can utilize COM: ASP, Visual Basic, Visual C++, Visual J++, the Windows Scripting Host, etc.

So a more correct question is what databases can ADO work with? The noon-technical answer: a lot!! The more technical answer: any data source that provides an OLE-DB or ODBC interface can be accessed by ADO.

OLE-DB is an application programming interface (API) for accessing data stores; OLE-DB serves as middleware, sitting between an application that needs to interface with a data store and the actual data store, facilitating communication between the app and the data store. A data store, as its name suggests, is a store of data. A relational database, like SQL Server or Access, is a data store - an email message or Microsoft Index Server are both data stores too, though. For more information on OLE-DB be sure to check out OLEDB.com and Microsoft's OLE-DB site.

ODBC (Open DataBase Connectivity) is an older data access standard developed by Microsoft. ODBC was Microsoft's attempt at creating one standard database protocol - when using ODBC an application could issue the same commands whether the database was SQL Server, Microsoft Access, or Oracle. ODBC is an older technology that has been replaced by OLE-DB. However, you will often see databases being referred to as ODBC-compliant. You can access these types of databases (ODBC-compliant databases) through an ASP page using ADO.

So if ODBC and OLE-DB are two middleware products, where does ADO fit in? Well, it too is a middleware component, another level of encapsulation for developers to utilize when needing data access. ADO presents data access in an object-based paradigm. ADO sits on top of the OLE-DB, handing off data requests to OLE-DB.

So, back to our original question: what databases can one use on an ASP page? Again, our technical answer is: any data source that provides an OLE-DB or ODBC interface. So what data stores provide such access? Tons of 'em. Here is a quick list with links to learn more about how to work with these data sources:

-- Microsoft SQL Server
-- Microsoft Access
[Connecting to databases using DSN and DSN-less connections]
-- Oracle [What do I need for connectivity to an Oracle database from ASP?]
-- Microsoft Excel
-- Microsoft FoxPro
-- Active Directory Service (ADSI)
-- Microsoft Index Server
-- DB2 Databases
-- Informix databases

(For more information on a number of related Web technologies be sure to check out the 4Guys Related Web Technologies article index!)

To connect to some of these data stores you need to have the proper ODBC or OLE-DB drivers installed on your computer. These should be freely available from the database provider's Web site. (For example, the Oracle ODBC drivers can be downloaded at: http://otn.oracle.com/software/utilities/software_index.htm.)

A great place to find a list of many common ADO connection strings is: http://www.able-consulting.com/ado_conn.htm?f=ado_conn.htm. From that page you can connection strings to databases ranging from SQL Server to DB2 to Visual Fox Pro to SQL Anywhere.... Be sure to check it out!

So as you can see, a plethora of data stores can be accessed and worked with from an ASP Web page!

Happy Programming!

FAQ posted by Scott Mitchell at 4/5/2001 11:49:47 PM to the Databases, General category. This FAQ has been viewed 88,900 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

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