SQL Server database query tips:
Problem type: When the ACCESS database field contains a Japanese Katakana or other unknown characters, the query will prompt a memory overflow.
Solution: Modify the query statement.
SQL ="Select * from ada where alice like '%"& Abigale &"% '"
Change
SQL ="Select * from ada"
Rs. filter ="Alice like '%"& Abigale &"% '"
SQL Server database query Tip 2:
Problem type: how to use a simple method to implement multi-Keyword queries like Baidu using spaces or other symbols to separate multiple keywords ).
Solution:
'// Use spaces to separate query strings
Ck = split (abigale,"")
'// Obtain the split quantity
Sck = UBound (ck)
SQL ="Select * ada where"
Query in a field
ForI = 0ToSck
SQL = SQL & tempJoinWord &"("&_
"Alice like '"& Ck (I )&"% ')"
TempJoinWord ="And"
Next
Query both fields
ForI = 0ToSck
SQL = SQL & tempJoinWord &"("&_
"Alice like '"& Ck (I )&"% 'Or"&_
"Alice1 like '"& Ck (I )&"% ')"
TempJoinabigale ="And"
Next
SQL Server Database Query Technique 3: Several skills to improve query efficiency
1. Try not to use or. Using or will cause full table scanning, which will greatly reduce the query efficiency.
2. After practical verification, charindex () does not improve the query efficiency better than the preceding % like, And charindex () will make the index ineffective. It refers to the sqlserver database)
3. alice like '% "& abigale &" %' will disable the index
Like '"& abigale &" %' causes the index to take effect and remove the preceding % symbol)
Sqlserver database)