Little experience in establishing a query engine about INDEX Server + ASP

zhaozj2021-02-16  42

This paragraph section is selected from the new "establishment of the Intranet / EXTRANET Application" in each bookstore. Such as the bookstore, Xidan Book Building, etc. Buy online to www.wanbook.com.cn or www.e-bookshop.com.cn. Book number is ISBN7113039448). This book details how to use Microsoft BackOffice Series products to form an intranet / extranet application. Through it, you will master the installation and setting of NT, use IIS to establish a web site, establish a network conferencing system through the ILS, establish an enterprise's mail and collaboration system with Exchange, establish a web database application with SQL Server, and build with Internet security and reliable Connection, establish a network TV / broadcast station with Media Server, build a powerful chat room with Chart Server, establish a personalized mailing list and analyze the access to the website with Site Server, and establish a B2B or B2C e-commerce website with Commerce Server. . In addition, this book also discusses the security of the network to guide you to create a more robust and secure web application. After reading this book, you will find that it is simple to realize colorful network applications ...

Absolute original, welcome to reprint. But please keep the above text.

Another way to establish a connection is through the SQL statement. Establish a connection to use the sp_addlinkedServer storage process. The syntax structure is as follows:

sp_addlinkedServer [@server =] 'Server' [,] [@ srvproduct =] 'product_name']

[,] [@ provider =] 'provider_name'] [,] [@ DatasRC =] 'DATA_SOURCE']

[,] [@ location =] 'location'] [,] [@ provstr =] 'proviker_string']

[,] [@ catalog =] 'catalog']

This memory process has seven parameters, which are as follows:

■ Server: The name of the connection to be established.

■ SRVPRODUCT: The product name of the data source to be connected. This parameter is empty.

■ Provider: The unique identifier for the product you want to connect. In the HKEY_LOCAL_MACHINESOFTWAREMICROSOFTMSSQLSERVERPROVIDERS item, there is a name for all connection data types supported by the local server.

■ Datasrc: An interpretation information as this data source. This parameter is empty.

■ Location: An interpretation information as this data source is located. This parameter is empty.

■ ProvStr: Connection string for this data source. This parameter is empty.

■ Catalog: Indicates the directory used when connecting. This parameter is empty.

The following table lists the value of the parameters for connecting different types of data.

Data Source Data Type Product_name Provider_name Data_Source Location Provider_String Catalog

SQL Server Microsoft Ole DB Provider for SQL Server SQL Server - - - - -

SQL Server Microsoft OLE DB Provider for SQL Server SQL Server SQLOLEDB SQL Server Server Name - Database Name (Optional) Oracle Microsoft Ole DB Provider for Oracle Any MSDara SQL * Netalias for Oracle Database - -

Access / Jet Microsoft OLE DB Provider for Jet Any Microsoft.jet.Oledb.4.0 Database File Full Path and File Name - -

ODBC DATA SOURCE Microsoft Ole DB Provider for odbc Arbitrary MSDasql System DSN of ODBC Data Source - -

ODBC Data Source Microsoft OLE DB Provider for ODBC Arbitrary MSDasql - - ODBC Connection Strings -

File System Microsoft OLE DB Provider for Indexing Service Any Msidxs Index Server Index Directory Name -

Microsoft Excel Spreadsheet Microsoft OLE DB Provider for Jet Any Microsoft.jet.Oledb.4.0 Excel File Full Path and File Name - Excel 5.0 -

Site Server Full-Text Queries Microsoft OLE DB Provider for Site Server Index Directory Name of any MSSEARCHSQL Site Server -

Note: Use this way will force the SQL Server server that is the same as the same connection name.

The following example will complete the same work as we do in front of Enterprise Manager.

Execute sp_addlinkedServer FileSystem,

'Indexing Service',

'Msidxs',

'Web'

In addition, there are several storage processes associated with the connection:

sp_dropserver: Used to delete the established connection, its syntax structure is as follows:

sp_dropserver [@server =] 'Server' [,] [@ Droplogins =] {'DROPLOGINS' | NULL}]

Where the Server parameter indicates the name of the connection to be deleted. DROPLOGINS indicates the login deletion that will be established at the same time.

SP_ADDLINKEDSRVLOGIN: Used to establish a login for the connection, its syntax structure is as follows:

sp_addlinkedsrvlogin [@rmtsrvname =] 'RMTSRVNAME'

[,] [@ useself =] 'useseelf']

[,] [@ locallogin =] 'Locallogin']

[,] [@ RMTUSER =] 'RMTUSER']

[,] [@ rmtpassword =] 'RMTPassword']

Where the RMTSRVNAME parameter is the name of the connection.

The value of Useseelf is True or False indicates whether you log in directly on the remote server. This requires a login to match the login together on the remote server. This parameter is default to true. Locallogin is a local login name. This parameter is empty. If you use the default, you mean that all local logins will be connected to the remote server.

RMTUSER and RMTPassword are login and passwords on remote servers, respectively. These two parameters will be ignored if the UseSelf parameter is TRUE.

Sp_LINKEDSERVERS: Will return information about all connections on the current local server. Its typical operation is as follows:

SRV_NAME SRV_PROVIDERNAME SRV_PRODUCT SRV_DATASOURCE SRV_PROVIDERSTRING SRV_LOCATION SRV_CAT

-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- ------------------------------

-Filesystem msidxs Index Server Null Null Web NULL

ZW SQLOLEDB SQL Server ZW Null Null Null

(2 row (s) affected)

The first line of data returned for us is a previously established Index Server connection. The second line of data is used by our Enterprise Manager to manage the connection of SQL Server. That is, SQL Server registered in Enterprise Manager.

sp_droplinkedsrvlogin: Used to delete logins established as remote connection. The syntax structure is as follows:

sp_droplinkedsrvlogin [@rmtsrvname =] 'RMTSRVNAME',

[@locallogin =] 'Locallogin'

Where the RMTSRVNAME parameter is the name of the connection. The Locallogin parameter is a local login established for the remote connection. To delete this login, there must be a remote connection that maps to this login must be presented.

转载请注明原文地址:https://www.9cbs.com/read-19426.html

New Post(0)