Creating an ODBC Data Source Name

Creating an ODBC Data Source Name

An ODBC data source is an ODBC data structure that identifies a database and the DBMS that processes it. Data sources identify other types of data, such as spreadsheets and other nondatabase tabular data stores, but we are not concerned with that use here.

The three types of data sources are file, system, and user. A file data source is a file that can be shared among database users. The only requirement is that the users have the same DBMS driver and privilege to access the database. The data source file can be e-mailed or otherwise distributed to possible users. A system data source is one that is

Figure 11-6

Minimum SQL Grammar

Summary of SQL

• CREATE TABLE, DROP TABLE

Conformance Levels

• Simple SELECT (does not include subqueries) • INSERT, UPDATE, DELETE • Simple expressions (A > B + C) • CHAR, VARCHAR, LONGVARCHAR data types

Core SQL Grammar

• Minimum SQL Grammar • ALTER TABLE, CREATE INDEX, DROP INDEX • CREATE VIEW, DROP VIEW • GRANT, REVOKE • Full SELECT (includes subqueries) • Aggregate functions such as SUM, COUNT, MAX, MIN, AVG • DECIMAL, NUMERIC, SMALLINT, INTEGER, REAL, FLOAT,

DOUBLE PRECISION data types

Extended SQL Grammar

• Core SQL Grammar • Outer joins • UPDATE and DELETE using cursor positions • Scalar functions such as SUBSTRING, ABS • Literals for date, time, and timestamp • Batch SQL statements • Stored procedures

Chapter 11 The Web Server Environment

local to a single computer. The operating system and any user on that system (with proper privileges) can use a system data source. A user data source is available only to the user who created it.

In general, the best choice for Internet applications is to create a system data source on the Web server. Browser users then access the Web server, which, in turn, uses the system data source to set up a connection with the DBMS and the database.

We need a system data source for the View Ridge Gallery VRG database so that we can use it in a Web database processing application. We created the VRG database in SQL Server 2008 R2, and the system data source will provide a connection to the SQL Server 2008 R2 DBMS. To create a system data source in a Windows operating system, you use the ODBC Data Source Administrator. 1

Opening the ODBC Data Source Administrator in Windows Server 2008 R2

1. Click the Start button and then click the All Programs button.

2. Click the Administrative Tools folder to open it.

3. Click the Data Sources (ODBC) program. We can now use the ODBC Data Source Administrator to create a system data source

named VRG for use with SQL Server 2008 R2: Creating the VRG System Data Source

1. In the ODBC Data Source Administrator, click the System DSN tab, and then click the Add button.

2. In the Create New Data Source dialog box, we need to connect to SQL Server 2008 R2, so we select the SQL Server Native Client 10, as shown in Figure 11-7.

3. Click the Finish button. The Create New Data Source to SQL Server dialog box appears.

4. In the Create New Data Source to SQL Server dialog box, enter the information shown for the VRG in Figure 11-8(a) (note that the database server is selected from the Server drop-down list), and then click the Next button.