Obviously, before you can start working with stored procedures, you'll want to set up a database that enables you to create them.
In this example, we'll use SQL Server 6.5. To create a new database within SQL Server, you first create a new database device and then create the database itself and assign it to the database device.
Note
A database device is one of two types of files in which databases are stored; backup devices are the other type. More than one database can be stored on a device.
Take these steps to create a new database device within SQL Server:
Once you have created the new database device, it will appear under the Database Devices node within the Server Manager window. You can later edit the device properties by right-clicking the device and choosing Edit from the context menu. You can edit the size of the device and also specify whether the device is mirrored. Mirroring makes a continuous copy of the information in the device to another device. This can help recovery in the event of a media failure.
Take the following steps to create a new database within SQL Server:
Figure 15-1 shows the SQL Server Enterprise Manager with the New Database dialog box ready to create a new database named VI6Samples. Note that the database device has already been created and is displayed under the Database Devices node.
Figure 15-1. The SQL Server Enterprise Manager showing the New Database dialog box.
After you have created the database within SQL Server, the next step is to start Visual InterDev, create your web project, and add a data connection to the database. After opening the Web project you want to work with, right-click the global.asa file within the Project Explorer and choose Add Data Connection from the context menu. This will launch the Select Data Source dialog box, which will allow you to create a new File DSN (data source name) for your database.
To configure the ODBC connection to your SQL Server database, take the following steps:
In the Create A New Data Source To SQL Server dialog box, enter a description for the data source and specify the name of the server that you wish to connect to. (See Figure 15-2.)
Figure 15-2. The Create A New Data Source To SQL Server dialog box, in which you specify the name of the server to connect to.
On the next screen, specify how SQL Server should verify the authenticity of the login ID. Choose With SQL Server Authentication Using A Login ID And Password Entered By The User, enter sa as the login ID, and click Next. (See Figure 15-3.)
Figure 15-3. The dialog box in which you specify how SQL Server should verify the authenticity of the login ID.
After following the steps outlined above, you have created a File DSN for your SQL Server data source. You can now select this File DSN and click OK to begin establishing the data connection within Visual InterDev. Now click OK in the SQL Server Login dialog box to log in to the database. The next step is to specify a name for the data connection and to specify the authentication information for the data connection both in the design-time and run-time environment.
Follow these steps to complete your definition of the database connection:
Figure 15-4. The Authentication tab of the Data Connection Properties dialog box, where you specify both design-time and run-time authentication information.