Microsoft SQL Server 2000 Super Management Manual (two or three)

xiaoxiao2021-03-06  53

23. Access Microsoft SQL Server from the Internet

Internet program design concept

Access SQL Server using ISAPI

Access SQL Server using ASP

Access SQL Server using XML

Summary of this chapter

Using Microsoft SQL Server 2000 on the Microsoft Windows 2000 job system platform, we can easily publish the SQL Server Database "publish (Publish)" to the Internet. The combination of Windows 2000 and Microsoft Internet Information Server (IIS) provides inclusive components and interfaces, and interact with SQL Server 2000 database. This chapter describes the basic concepts of accessing Microsoft SQL Server from the Internet. Since this book is not a special book development, only an overview of several different access methods. The details of the relevant format design, there are many good books on the market for reference.

This chapter will begin from the concept of internet program design and introduce the internet access interface design interface in Windows 2000. Then introduce the basic concept of ODBC programming and ADO, and several ways to access SQL Server, including ISAPI and ASP. Finally, we will discuss XML, understand what is XML and how to use. This chapter covers many themes, and believes that it should help understand the basic tools for internet access design.

Internet Code Design Concept This section will learn the basic concepts of SQL Server and Internet Application. These applications must contain two different interfaces to perform different tasks: one interface is used for users, and the other is used for SQL Server. This section describes the connection between the application and SQL Server, including IIS and ODBC. With Windows 2000 and IIS 5 as an internet platform, Windows 2000 and IIS 5 use Windows 2000 and IIS 5 as a platform for internet applications, allowing program developers to access various functions of SQL Server. Programmed developers can utilize the function of integrating data inventory, Open Database Connectivity, ODBC) Source, OLE DB (a powerful component object model for accessing universal data) (Component Object Model, COM) interface), and a web application architecture called Internet Server API (ISAPI), the last architecture is a powerful competitor of traditional CGI (Common Gateway Interface, common gate interface) application. ODBC is undoubtedly the best choice for the database interface using the ODBC data source. Through ODBC, program developers can access the source type of information, which is widely available from the most simple text file to Microsoft Excel data sheet, and even Microsoft Access and SQL Server libraries can access. ODBC provides a library program designer a universal and powerful abstract level. Development of internet access using SQL Server does not require any special means. To access SQL Server through a Web Server, ODBC data source has provided some other methods. They can do this through an OLE DB COM item collection called ActiveX Data Objects (ADO). ADO provides an object-oriented-interface to access ODBC data sources, which is simpler than using ODBC C API. With ADO, program developers can initialize some simple objects to represent database wirings, commands (such as SQL statements or pre-depreciation programs), and data recording (RECORDSETS), which is similar to the client data indicator and has a near servers Document library data indicators function. All of these database objects and interfaces make us developed on the Internet using SQL Server, especially in ODBC, some powerful features, such as connectivity purposes. An ODBC-based web application, how to properly use the connection to one of the most important issues. Connection Sharing allows a mid-term application to maintain and share connectors with the SQL Server repository. The shared wiring will remain open in the specified time period and share to several users. Establishing a connection is usually a resource-intensive job and causing the burden on the database server. Since the Web Server and the associated Internet application manipulates the vast majority of traffic, the connection to the establishment connection and (especially) reconstruction connection is minimized through the database wiring. As a result, the user's connection time can be faster and also reduces the resource consumption of the database server. In the preset situation, IIS 5.0 will dynamically allocate the database connection.

Note When using an ODBC data source and ADO, an ADO connection article should be used based on each page. Compared to the use of the entire working stage object, the connection item is established when it is required, and it is immediately released immediately, the database connection can release the common state faster so that other wirings are used. This can greatly reduce the time of the Internet application user waiting for the connection. Select a network program library

Although SQL Server can support several different network program libraries such as Banyan Vines, you should use the TCP / IP network program library when you deploy a SQL Server database on the Internet. In many options in the SQL Server network program, TCP / IP provides excellent network adaptability, connection speed and efficiency. (The network program is explained in Chapter 11.)

If TCP / IP is used as a network program library, SQL Server security mode will be limited to only standard security can be used. This mode is verified using SQL Server login. TCP / IP does not support integrated security, which uses Windows 2000 account to verify that provides better security and more efficient methods to maintain centralized management of accounts in the SQL Server system. However, the use of integrated security is also deteriorating the performance of the system on certain levels.

First, if the integrated security is used, the effectiveness of the ODBC connection is seriously limited. When integrated security is taken, the user who enters the database server that enters the database server must be used through the Web Server. As a result, the benefits of the connection can be provided completely, because the shared connection will be rejected, and the same login and password as the existing wiring must be used.

Second, more than half of the connection-based security lines are used with integrated security, which will generally be slow. The use of a list of tubes will also cause some of the issues shared. You can use an anonymous account to log in to a valid SQL Server, which is used in a list of channels, but most web servers will take challenges and respond to verification mode or basic verification mode to force a separate connection. SQL Server. The result is whether orientation of any effectiveness improvement available for the connection.

If the SQL Server and the Web Server are split on different machines, using integrated security will also limit the selection of the verification mode. Challenge and Response Verification Mode will not be available, and only basic verification modes and anonymous verification modes can be selected. On the Internet, let a security system allow anonymous verification by unwise, and basic verification, as you have just said, will make the connection to play unable to play.

Access SQL Server ISAPI using ISAPI is a set of sets of auto calls, which are designed to provide a powerful tool that can extend IIS functionality to internet application developers. The ISAPI application provides superior performance and low-order control. In fact, the ISAPI application will be more efficient than other web applications on IIS. In addition, through ISAPI, program developers can apply all of the Win32 APIs. The Dynamic Library (DLL) of the ISAPI application has two categories: Extension and Filter. Since DDL is a typical compiled program code, the execution speed is much faster than the transpredational code or Script language. If your internet application is high in execution speed and ductility, it will take advantage of the best choice even in programming and modification, the ISAPI expansion program and filters are still the best choice. In the next few sections, we will detail the ISAPI expansion program and filter, then explain the design and use of the ISAPI application. The implementation of the ISAPI expanded program ISAPI expansion is the same as DLL, which will be loaded into an IIS processing space or another processing space separate from it. When you install the ISAPI expansion program on a Web Server, you can choose to load. If the application is not stable, the expansion program should be loaded into a separate processing space to avoid an error of the ISAPI expansion to ruin the entire Web server. This is likely to happen if the ISAPI expansion program is also in the test phase or has not been fully tested. To call an ISAPI expansion, you can use the virtual path of .dll in the URL, for example: http://www.mydomain.com/sampleisapi.dll.

When we use this way to call the ISAPI expansion program, if it has not been loaded, this ISAPI expansion program will be loaded into the memory and control the entire requirements, and IIS turns into server and user browser. A vector of a simple transfer material. An example of this application is the self-reserve search engine on the Internet station.

ISAPI filter

The implementation of the ISAPI filter is also the same as DLL, but they load into IIS processing space when the web server is started, and remains in the memory until the server stops. The ISAPI filter can be set to receive any number of filter event notifications, which will appear when IIS processing each HTTP requirement and generating an HTTP response. When an ISAPI filter is loaded, the filter will communicate with IIS, and the event should be notified of the filter will be transmitted through a special structure. Whenever there is a similar event occurs, the event registration (registered) will receive an event notification message to the filter that should be notified.

ISAPI is a powerful tool that can be used to perform compression or encryption, custom verification, web traffic logs and analysis, and even servers Scripting Engine. You can create an ISAPI filter check each of the web page settings that are transferred to the user, search for special labels, and modify them to have a consistent look, just as an ASP page.

The ISAPI filter can check each of the information flow coming in and going, this ability makes it a good and very flexible tool. However, if there are too many ISAPI filters, the performance and ductility of the entire website will be completely reduced. For example, if each single input and output web pages need to be filtered, it is possible to cause serious burden on the system due to excessive activities of the filter. Special attention should be paid to how to minimize its work when you decide the filter to be performed. For example, in a customized encryption structure, the filter should only be read from the user end from the client or write the data to the client in IIS. This can reduce the number of works that the ISAPI filter should do. ISAPI limit

Although ISAPI technology can provide the best effective performance, it also has some shortcomings. Since the writing isapi expansion program and the filter use C or C , the development ISAPI expansion program and the filter will be more difficult to consume more than the development of the Script web page. When the ISAPI expansion program is modified with the filter, the entire application needs to be recompiled, not just replacing the file. Furthermore, even if the ISAPI expansion program and the filter execution speed generally comes fast than the servo end Script similar to its function, they cannot guarantee the ideal ductility. Finally, some programming abstraction process (most server-side Script program developers think that this), especially Session objects, surprisingly no in the ISAPI program design. The ISAPI program design can be said to be quite low-order than the program of the servo-end Script.

Access SQL Server ASP using ASP is a server-side Script environment, program developers can use it to create interactive, dynamic webpages, and develop powerful web applications. An ASP file is a plain text file named .ASAP, which can contain any text combination, HTML tag, and server-side Script. Although ASP is purely executed by the server, program developers can still include user-end script in their HTML code, and perform through the user's browser instead of transmitting the Web server. When the web server receives a request for the ASP file, the web server performs the files contained in the specific label SRIPT and create a web page. The result of output is a pure HTML file, which may include the user-end SRIPT element just mentioned. This file is then transferred to the user-end browser, and the browser executes or expresses these components on the screen. No ASP original code is transferred to the user. Their analysis and implementation are all completed on the server. The user does not see the script command to establish a web page, and they see what these commands are established. In addition to including the server-side Script, the ASP file can also include a call to the COM component to perform many different tasks, including information inventory. In addition, commercial logic objects across several different development environments can be performed. ASP is quite neutral in language. Program developers can use the Script language they are familiar with, such as Microsoft Visual Basic Scripting Edition (VBScript), Microsoft JScript or Perl to develop ASP files, and discovering that the development process is not difficult. ASP web pages can use Script languages ​​that have been installed in a web server and compatible with COM. Scripting Engine is a program that can be used to handle commands written in a specific language. IIS included Scripting Engine support common VBScript (based on Visual Basic) and the Microsoft version of the JScript (European Computer Manufacturer Manufacturers Association, ECMA) 262 language specifications. From the workforce manufacturer, you can get Scripting Engine like the language of Perl. The ASP has some advantages that transcends traditional CGI applications. Previously, the program developers who have been familiar with VBScript or JScript will not need to learn new program languages, like C or Perl. The ASP provides some objects for the user's working phase, requires and responses, which makes the ASP's function more powerful and makes personalization of content easier. In addition, the ASP can process and collect HTML forms only compared to the CGI application developed and compiled with C language, and the ASP only needs to handle the HTML form information and store it in the database. Since all ASP program is embedded in an HTML file, the ASP maintenance is also very easy.

Access SQL Server XML using XML is an abbreviation of Extensible Markup Language, but XML is not actually a language. It is actually a system that can be used to define other languages, and the general syntax of the expression structure. Unlike the HTML tag language that is only used to specify the web file rendering method, XML specifies the content and structure of the file. The so-called structured data refers to information marked according to its content or use. XML is born with an extendable property. Program developers use XML to define data within the web page, and limit the level of the details according to their needs. For example, program developers can use the or tag to describe information about books and publishing. If additional definitions are required, program developers can add <RetailPrice>, <Publisher>, or even <ISBN> tab. Using XML is similar to the establishment of a data sheet in the database, it must determine the information element required by the application, as if it is determined which information is needed to completely describe the information list in the data sheet. Since XML does not describe the presentation, an XML file can be displayed in various ways as long as writing is written, including a web browser, a mobile phone, a vehicle monitor, and the like. These devices may have their own display requirements: Computer screen may be 800 × 600 pixels, and a wireless internet device may only support 200 × 200 pixels. Since XML only defines the structure and content of the file, these devices can be presented by using their respective XML browsers, they can be presented according to their specific display requirements. Unlike HTML files, the XML file can be used more long after writing, and it will not be eliminated because of new display technology. The XML is really useful to use the file object model (Document Object Model, DOM) to generate interactive features. The DOM is a interface that defines the mechanism of data in the access file. Using DOM, program developers can use standardized ways to write dynamic content. For example, program developers can use the DOM to make the content to generate behavior in some cases. Using this method allows files to add some effects, such as allowing some part of the text to compute, a book name that is tagged in XML is called <title> - Sliding in the user's mouse It will change the color overdose, saying that this is a super-linking to a bookstore in a single line. It is not easy to use the current special DOM and style table specifications to achieve such effects, but new DOM standards developed by W3C will help XML program developers maintain real platform independence. XML also has quickly become the standard of exchange information and documents. XML can be used to exchange information between database systems that differ from the Internet. For example, a car parts supplier can exchange inventory information with XML and automakers, even if these two manufacturers may use two completely different database systems on two different platforms. Since the XML describes the information structure, it can become a bridge between the two systems that are neither also incompatible.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-110836.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="110836" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.047</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = '61mpWGES7aIad6IvAD5VEyDxXWz_2BlhEb90pB3RbhSBkZC43SaysKNMnr7OgKfGl6G_2Fi3m1wTVToOtgLK'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>