همه مطالبتون درسته، ولی نمیدونم کدی که من بالا نوشتم، تو vb جواب داد، ولی کد شما رو میزنم جواب نمیده ولی میدونم درسته !!!
من خودم هم میدونم اینشکلیه، ولی شما برید تست کنید با * و % .
و یک نکته دیگه بعد از * یک کوتیشن تکی(کاما یا همچین چیزی (')) بود اسمش نمیدونم یادم رفته !!!
ممنون، شما هم تست کنید، تو sql * جواب میده فکر کنم، اگه جواب داد تو vb بگین مشکل کد من چیه !!!
On Error Resume Next
ado.CursorLocation = adUseClient
If txtFind = "" Then
ado.RecordSource = "SELECT * FROM T_Froshandegan ORDER BY id_ff"
Else
ado.RecordSource = "Select * From T_Froshandegan Where lname_ff LIKE '" & txtFind & "%'"
End If
ado.Refresh
dg.Refresh
همین کد جواب داد !!!
اینم از داخله msdn :
LIKE PredicateRemarks
In a LIKE search pattern, to use the percent sign ( % ), underscore ( _ ),and left square bracket ( [ ) as literal characters rather than as wildcard characters, surround the characters with square brackets. The right square bracket ( ] ) matches itself unless preceded by a left square bracket. The range character ( - ) matches itself unless it is inside square brackets and preceded and followed by a single character.
The following table shows patterns that illustrate using wildcard characters as literal characters.
Pattern Meaning LIKE 'd%' d followed by any string of 0 or more characters LIKE 'd[%]' d% LIKE '_n' an, in, on, etc. LIKE '[_]n' _n LIKE '[a-cdf]' a, b, c, d, or f LIKE '[-acdf]' -, a, c, d, or f LIKE '[[]' [ LIKE ']' ] LIKE '[ab]cd]e' acd]e, or bcd]e
Examples
The following example returns rows consisting of the DocAuthor, DocTitle, and size properties for all files under the virtual roots "/contracts" and "/legal", written by authors whose names are "Smith", "Smyth", "Smythe", and so on, where the comment field of those documents does not contain words starting with "real", such as "realty" or "realtor".
SELECT DocAuthor, DocTitle, size
FROM SCOPE('"/contracts", "/legal"')
WHERE DocAuthor LIKE 'SM_TH%'
AND DocComments NOT LIKE 'REAL%'