Combination of SQLServer and IndexServer 2/3

Source: Internet
Author: User
Tags odbc connection web database
This article is excerpted from the book "using Backoffice to create an IntranetExtranet application" (available in various bookstores. Such as Haidian Library City and Xidan Library Building. Overseas or readers who need to deliver the door can go to www.wanbook.com.cn or www.e-bookshop.com.cn online purchase. The book number is ISBN7113039448 ).

This article is excerpted from the book "using Backoffice to create an Intranet/Extranet application" (which is now available in various bookstores. Such as Haidian Library City and Xidan Library Building. Overseas or readers who need to deliver the door can go to www.wanbook.com.cn or www.e-bookshop.com.cn online purchase. The book number is ISBN7113039448 ).


This article is excerpted from the book "using Backoffice to create an Intranet/Extranet application" (which is now available in various bookstores. Such as Haidian Library City and Xidan Library Building. Overseas or readers who need to deliver the door can go to www.wanbook.com.cn or www.e-bookshop.com.cn online purchase. The book number is ISBN7113039448 ). This book describes in detail how to use the Microsoft Backoffice product series to build Intranet/Extranet applications. With this, you will learn how to install and set up NT, use IIS to build a Web site, establish a network conference system through ILS, use Exchange to build an enterprise's mail and Collaboration System, and use SQL server (WINDOWS platform) powerful database platform) establish Web database applications, establish secure and reliable connections with the Internet using Proxy Server, Use Media Server to establish network TV stations/broadcast stations, use Chart server to establish powerful chat rooms, and use Site Server to establish personalized email list and analysis of website access, use Commerce Server to establish B2B or B2C e-Commerce websites. In addition, this book also discusses network security to guide you to build a more robust and secure network application. After reading this book, you will find it easy to implement a variety of network applications ......
Absolutely original. You are welcome to reprint it. However, be sure to keep the above text.

Another method for establishing a connection is through SQL statements. Establish a connection to use sp_addmediaserver for storage. The syntax structure is as follows:
Sp_addmediaserver [@ server =] 'server' [,] [@ srvproduct =] 'product _ name']
[,] [@ Provider =] 'provider _ name'] [,] [@ datasrc =] 'data _ source']
[,] [@ Location =] 'location'] [,] [@ provstr =] 'provider _ string']
[,] [@ Catalog =] 'catalog ']
There are a total of seven parameters in the stored procedure. Their meanings 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 by default.
■ Provider: the unique identifier of the product of the data source to be connected. In the Registry, the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ mssql (powerful database platform on WINDOWS) Server \ Providers item contains names of all connection data types supported by the local Server.
■ Datasrc: Used as an explanation of the data source. This parameter is empty by default.
■ Location: the location of the data source. This parameter is empty by default.
■ Provstr: the connection string of the data source. This parameter is empty by default.
■ Catalog: Specifies the directory used for connection. This parameter is empty by default.
The following table lists the values of parameters used to connect different types of data.
Data source data type: product_name provider_name data_source location provider_string catalog
SQL server (WINDOWS powerful database platform) Microsoft ole db Provider for SQL server (WINDOWS powerful database platform) (Note )-----
SQL server (WINDOWS powerful database platform) Microsoft ole db Provider for SQL server (WINDOWS powerful database platform) SQLOLEDB SQL server (powerful database platform on WINDOWS) server name-Database Name (optional)
Oracle (large website database platform) Microsoft ole db Provider for Oracle (large website database platform) Any msdaora SQL * Netalias for Oracle (large website database platform) database ---
Access/Jet Microsoft ole db Provider for Jet full path and file name of any Microsoft. Jet. OLEDB.4.0 database file ---
ODBC data source Microsoft ole db Provider for ODBC any MSDASQL System DSN of ODBC data source ---
ODBC data source Microsoft ole db Provider for ODBC any MSDASQL--ODBC connection string-
File system Microsoft ole db Provider for Indexing Service: Index directory name of any MSIDXS Index Server ---
Microsoft Excel Spreadsheet Microsoft ole db Provider for Jet full path and file name of any Microsoft. Jet. OLEDB.4.0 Excel file-Excel 5.0-
Site Server Full-Text Queries Microsoft ole db Provider for Site Server any MSSEARCHSQL Site Server Index directory name ---
Note: This method will force you to connect to an SQL server with the same connection name (a powerful database platform on WINDOWS) server.
The following example completes the same work we have done through Enterprise Manager.
EXECUTE sp_addmediaserver FileSystem,
'Indexing service ',
'Msidxs ',
'Web'
In addition, there are several connection-related storage processes:
Sp_dropserver: Used to delete established connections. Its syntax structure is as follows:
Sp_dropserver [@ server =] 'server' [,] [@ droplogins =] {'droplogins' | NULL}]
The server parameter specifies the name of the connection to be deleted. Droplogins indicates that the login established for this connection will be deleted at the same time.
Sp_add1_srvlogin: used to create a login for the connection. Its syntax structure is as follows:
Sp_add1_srvlogin [@ rmtsrvname =] 'rmtsrvname'
[,] [@ Useself =] 'useself ']
[,] [@ Locallogin =] 'locallogin']
[,] [@ Rmtuser =] 'rmtuser']
[,] [@ Rmtpassword =] 'rmtpassword']
The rmtsrvname parameter indicates the connection name.
The Useself value is TRUE or FALSE, indicating whether to use this logon directly on the remote server. This requires a logon that matches the logon with the remote server. This parameter is set to TRUE by default.
Locallogin is a local login name. This parameter is empty by default. If the default value is used, all local logins will be connected to the remote server.
Rmtuser and rmtpassword are the login names and passwords on the remote server respectively. If useself is TRUE, these two parameters are ignored.
Sp_linkedservers: returns information about all connections on the current local server. The typical running result is as follows:
SRV_NAME SRV_PROVIDERNAME SRV_PRODUCT SRV_DATASOURCE SRV_PROVIDERSTRING SRV_LOCATION SRV_CAT
Certificate ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-Filesystem msidxs index server NULL web NULL
Zw sqloledb SQL server (powerful database platform on WINDOWS) ZW NULL
(2 row (s) affected)
The first row of data returned is the Index Server connection we established earlier. The second row of data is the connection we established in Enterprise Manager to manage SQL server (a powerful database platform on WINDOWS. That is, the SQL server registered in Enterprise Manager (a powerful database platform on WINDOWS ).
Sp_droplinkedsrvlogin: Used to delete a logon created for a remote connection. The syntax structure is as follows:
Sp_droplinkedsrvlogin [@ rmtsrvname =] 'rmtsrvname ',
[@ Locallogin =] 'locallogin'
The rmtsrvname parameter indicates the connection name. The Locallogin parameter is a local logon established for a remote connection. To delete this logon, you must have a remote connection mapped to this logon.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.