| | |
How to using "like" in VB6
![]() |
What is the error message you get? SQL seems ok to me.
%-character is used for pattern matching and it matches any number of characters:
sql = "select * from [table] where [field] like 'VB%'"
matches [field] starting with "VB" (like "VB6 Language"),
sql = "select * from [table] where [field] like '%VB'"
matches [field] ending with "VB" (like "Microsoft's VB"), and
sql = "select * from [table] where [field] like '%VB%'"
matches [field] containing "VB" ("My VB6 Tutorial")
%-character is used for pattern matching and it matches any number of characters:
sql = "select * from [table] where [field] like 'VB%'"
matches [field] starting with "VB" (like "VB6 Language"),
sql = "select * from [table] where [field] like '%VB'"
matches [field] ending with "VB" (like "Microsoft's VB"), and
sql = "select * from [table] where [field] like '%VB%'"
matches [field] containing "VB" ("My VB6 Tutorial")
Teme64 @ Windows Developer Blog
•
•
•
•
For MS Access, use * (asteriks) instead of %
Teme64 @ Windows Developer Blog
![]() |
Similar Threads
- COMPILE A "STANDALONE" .EXE FILE (Visual Basic 4 / 5 / 6)
- Using "Tabbed Dialog" or "TabStrip" (Visual Basic 4 / 5 / 6)
- msgbox that includes "yes to all" and "no to all" (Visual Basic 4 / 5 / 6)
- Is "Visual Basic 2005" Express edition .NET? (VB.NET)
- Help with "My" functions! (Visual Basic 4 / 5 / 6)
- Visual Basic "Classes" and "Class Modules" (Visual Basic 4 / 5 / 6)
- Codes for "Find" and for "Tip of the day" (Visual Basic 4 / 5 / 6)
- "HELP" RUNNING MSDOS COMMAND ON VB (Visual Basic 4 / 5 / 6)
- "Error in linking List box with the VB6.0 database" (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Having Problems With my VB6 Source Code...HELP?!
- Next Thread: about module
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





