Home
Link To Us
Components
Resources










Site Menu

An Overview in Creating an ActiveX DLL for Use with ASP Scripts

Setting up a DSN-Less Database Connection

The Complete FileSystem Object Reference Guide

Search the Web for other ASP Tutorials

A Note From the Author

A Good ASP Database Resource
cover
More Resources




















Top Ranked
Reference Books









An Overview in Utilizing ASP to Provide Database Access Through Web Browsers
by Derrald Farnsworth-Livingston

Technical Setup Stuff

In this document we will discuss the ability to access SQL Server databases through Visual Basic commands, both in Visual Basic programs and Visual Basic Script. In order to begin a Windows NT 4.0 Server or Windows 2000 Server machine must be installed. SQL Server must then be set up on this machine. Internet Information Server 4.0 (3.0 will work, but the drivers must be installed) must also be configured (5.0 for Windows 2000).

Odie B What?

ODBC stands for Open DataBase Connectivity (ODBC). This is an Application Programming Interface (API) that allows for data extraction from a database through a unified source. In the past it was difficult to extract information from various databases. Each had its own language that had to be coded. If a user wished to switch databases the program normally had to be recoded. Now, the job of accessing several different databases is simplified. One must only program in the ODBC language that is a combination of the ODBC API function calls and SQL (Structered Query Language). Most databases now support this standard and all that is needed to interact with various databases is the correct ODBC driver for the database and knowledge of SQL.

To begin accessing various databases, the correct driver must first be installed. The Microsoft Access, dBase, FoxPro, and SQL Server drivers are the standard drivers installed with Windows NT Server. Drivers for various other databases such as Sybase, Informix, and Lotus Approach are easily attainable.

Once the correct driver is installed a DSN (Data Source Name) must be configured to access a particular database. One can either set up a System DSN or a User DSN. The User DSN only allows the creator of the DSN to access the database through the data source. In order for multiple users on the machine to access a particular database either multiple User DSNs or a System DSN must be configured. A System DSN allows all the users of a machine to access the database through that data source.

We can set up a sample DSN easily in either Windows 95/98 or Windows NT. First we go to the ODBC control panel. We then choose the System DSN tab. Click on Add and choose Microsoft SQL Server driver. Click the next button. Next we are prompted to enter some information for the data source. The name we will use for the Data Source will be Students. The Description can be anything. The Server that we will use is BUBBA.

If you are using the 2.x version SQL Server driver for Windows 95/98/NT we must click the options button at the lower right corner of your dialog box. Under database name type Sample. Then click ok. Windows 95/98/NT ODBC Version 2.x users are now finished.

If you are using SQL Server driver version 3.x Windows NT you must click the next button. This prompts you for login information. Choose the radio button next to "With SQL Server authentication using a Login ID and Password entered by the user". The text boxes at the bottom of the dialog box now become enabled. Under Login ID type sa and leave the password field blank. Click the next button. We must now choose the database that will allow us to access the table that we want. Here we have a list of database objects retrieved from the SQL Server. Choose sample and then click the next button. Click the next button once again, leaving the default settings. If you wish to keep a log of the SQL queries set up the path and file names, otherwise do not enable this option. Now we can click the finish button. Our DSN is now set up. One nice feature of the Windows NT ODBC manager over the Windows 95/98 managers is that we can now test the datasource to see if it correctly connects with our database. We can do that now by clicking "Test Data Source".

We have now set up an ODBC Data Source to interact with a database on a Microsoft SQL Server.


Sections

Section 1: Setting it all Up
Section 2: SQL and Stuff
Section 3: VBPower!
Section 4: ASP Results
Printable Version

The Bookworm
Search the Tutorial-Web library for books on any topic!
Sponsors

Search Now:
In Association with Amazon.com

Enter your email address to join our mailing list!
We will NOT sell your name to advertisers