SQL Server7.0 Web Data Site Skills

zhaozj2021-02-08  331

"Database Information" Search: Use the LIKE syntax of the SQL instruction, or the Chinese Full Text Search feature of Microsoft SQL Server 7.0.

Microsoft INDEX Server

The Microsoft INDEX Server included in Windows NT Option Pack provides search features of Chinese full-text retrieval, you can search for Microsoft Word or Microsoft Excel files, text, html, and ASP file formats in Website.

SQL Directive LIKE Search

Search for General Database Information, you can use the LIKE syntax of SQL instructions, as follows: SELECT * FROM Data Sheet Name Where column name Like '% search strings%' 譬, "SELECT * home WHERE address LIKE '% Taipei City % '"Can search for the address field in the customer data sheet including Taipei City. Using the biggest shortcomings of the LIKE syntax, the action is too slow, because the information in the database must be used to search. In addition, although the MEMO type field data of the Access database can also be searched, it is unable to search for some type of field information, such as the type of sext type of SQL Server cannot search for SQL instruction LIKE syntax.

SQL Server 7.0 full-text search

For the information on the database, the best way to use the Full Text Search feature of Microsoft SQL Server 7.0, you can make Chinese full-text retrieval search features for char, varchar, text, ntext, nchar, nvarchar type fields.

You must install the Full Text Search part of Microsoft SQL Server 7.0, which is not included in the general installation steps of SQL Server 7.0, and must be installed additionally to use Chinese full-text search features. To set the steps to be searched, you must first set the information table to be searched. To perform [SQL Server Enterprise Manager], the information table to be searched, such as the [Northwind] Database [CUSTOMERS] data table, right-click, select [ [Define full-text indexing on a table]. The screen of [fulll-text indexing wizard] will be displayed. Press [Next] to select the field that is the unique index. Press [Next] to select the field that is the unique index. Press [Next], select or new Catalog to store index information. Then press the [New Schedule] button to schedule the index stroke, set how long to do an index, [jobType] can select [FULL] or [incremental], [FULL] to repay the data on the entire data sheet, [incremental] Only the data on the data sheet is indexed, such as the data that is scheduled to be dynamic to the data sheet every day. Press [OK] and [Next], it is defined to set the information table to be searched.

At this time, the information sheet for the search is not taking the index, and the Catalog set in [Full-text catalogs], if [Custom], [Full Population], [Full Population], the [Full Population], to re-index the entire data sheet .

The above setting will be indexed on the data sheet for data sheet every day. When the information sheet is powered, because the index has not been indexed immediately, it is necessary to make an index in the next day, it can be found.

How to search the server library through the Internet or Intranet, search through the Internet or intranet, search for the information of the servo database through internet or intranet? On the platform of Windows NT, the best choice is to use the IIS (Internet Information Server) website server, you can use the ASP (Active Server Pages).

Let's take a look at the "Full Text Search" full-text search (FULL TEXT SEARCH) Example ft1.asp execution results, using the browser, browse the results of the FT1.asp, and display the records to the information.

The Chinese full-text search in SQL Server 7.0 is very simple, as long as the SQL instruction uses Contains' language

Method, as follows:

SELECT * FROM Data Sheet Name Where Contains (Rained Name, 'Search Conditions ")

For example, "SELECT * from Customers Where Contains" "can search for the address field in the customer's data sheet including Taipei City.

First, the ASP program is set to the database, and the ASP program that links to the SQL Server database is as follows:

Cn.open "driver = {SQL Server}; Database = Database name; server = (local); uid = sa; pwd ="

After setting the database connection, the second step is to set the SQL instruction, save the results of the SQL instruction query to the RSET object RS, read the data library field by RS ("field), rsmovenext Move to the next record, determine if the RS.eo is determined whether or not to the last pen, match the do while ... loop, you can obtain all the records of the query results. In addition to providing ODBC drivers, SQL Server 7.0 provides OLE DB Provider, how does ASP access SQL Server through OLE DB? The ASP has access to the difference between SQL Server through the OLE DB and ODBC driver, who is required for the OLE DB. Take the SQL Server method. The ASP program that connects to the SQL Server library is as follows:

Cn.Provider = "sqloledb"

Cn.open "server = (local); UID = sa; pwd =; database = database name"

Searching for the keywords and other keywords. In addition to Contains, FreEtext can also be used. For details, please refer to the Books Online of SQL Server 7.0.

From: http://program.szata.com/

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

New Post(0)