Using ASP to Access SQL Server

3 4

ASP is a server-side scripting environment that developers can use to create interactive, dynamic Web pages, which they can use to build powerful Web applications. An ASP file is a text file with the extension .asp and can contain any combination of text, HTML tags, and server-side scripts. Although ASP is purely server side, developers can include client-side script with their HTML code, which is not processed by the Web server but rather by the client browser.

When a Web server receives a request for an ASP file, the Web server processes server-side scripts contained in special tags in the file to build a Web page. The result is a pure HTML file, which, again, can include client-side script components. This file is then sent to the client browser. The client browser renders these components on the screen. None of the ASP source code is ever transferred to the client. It is all parsed and stripped at the server. Users cannot view the script commands that created the page they are viewing.

In addition to containing server-side scripts, ASP files can contain calls to COM components that perform a multitude of tasks, including database access, and can implement business logic objects that can be shared across several development environments.

ASP is designed to be language neutral. Developers skilled in working with scripting languages such as Microsoft Visual Basic Scripting Edition (VBScript), Microsoft JScript, or Perl will find developing ASP files a familiar process. ASP pages can use a scripting language for which the Web server has an installed, COM-compliant scripting engine. A scripting engine is a program that processes the commands written in a particular language. IIS includes scripting engines for the popular VBScript (based on Visual Basic) and JScript (the Microsoft implementation of the European Computer Manufacturers Association [ECMA] 262 language specification) languages. Scripting engines for popular languages such as Perl are available from third-party vendors.

ASP has several advantages over conventional CGI applications. As mentioned, developers who are already familiar with VBScript or JScript will not have to learn a new language such as C or Perl. ASP offers enhanced functionality by providing objects for user sessions, requests, and responses, which make developing personalized content much easier. Additionally, an ASP file requires much less time and code in order to process and collect HTML form information and store it in a database than does a full-blown CGI application written and compiled in C. And because all ASP code is embedded directly in the HTML document, maintainability is increased.



Microsoft SQL Server 2000 Administrator's Companion
Microsoft SQL Server 2000 Administrators Companion
ISBN: B001HC0RPI
EAN: N/A
Year: 2005
Pages: 264

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net