ACCESS database LIKE query

xiaoxiao2021-03-06  83

Original website:

Http://www.china-askpro.com/msg15/qa22.shtml

Q newstar: PNT4.0 SP5 IIS4 Access 97 Tools: ASP Problem: I have a customer file database, there are more than 13,000 data, using the ASP to extract database records with SELECT NAME, Address, LXR, Tel from Khda WHERE Name Like '% Jianghua%' The selected record is 0, but in fact, there is such a record in the database. If you use SELECT NAME, Address, LXR, Tel from khda where name, tel from khda where name lick '%, Jianghua%' and qy = 'Wuhan, can find the correct record. Report the memory overflow if the% of the first SQL in the ACCESS 97 help is reported to *. The second sentence can be executed, but the record cannot be found.

A Answer:

If you use ADO, then this problem occurs, mentioning Access 97 in the "NT Network Database Speed ​​- Design Instance" (China Railway Publishing House 1998) does not support the LIKE query. I also found this problem when I design a search engine in an intranet. I was first obtained by get the value of the current field, and the INSTR function provided by VBScript judges whether to find it is included. Also, because the efficiency of Access 97 is poor, in particular for the SQL statement, it is better to do so much data or other databases. Zhou Dong's opinion: In fact, ADO is supported, but only 2% in the LIKE statement, such as: select * from databasename wherefieldname Like '%% XX %%' can get the correct query results. This problem also plasted at the same time. I have been a long time. Now I have a solution, share with everyone! :) CHENY's opinion: The wildcard usage of Like in Access is this: "?" Means any single character; "*" indicates zero or more characters; "#" indicates that any number is: SELECT * from DatabaseName Where FIELDNAME LIKE '* XX *' SZR, Majie Opinions: This kind of query with fuzzy nature I think I think the INSTR function provided by VBScript is better, and the specific syntax refers to its function. Such as: select * from tab_name where INSTR (field 1, condition) = 1

This question is answered by kurt.

Additional Keywords: Programming, Source Program, Programming, Source Code, Visual Basic, VB, SQL Query, SQL Server, SQL, Query, SELECT.

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

New Post(0)