|
-
Mar 27th, 2007, 06:58 PM
#1
Thread Starter
Junior Member
String search in Access [RESOLVED]
Hi, I am trying to search 3 possible strings in a table from a data base. Do you know the code to specify the search?. I am looking for something like a Instr, but for a search:
Code:
Set rsCan = dbtrad.OpenRecordset("SELECT * FROM TDOKUMENTE WHERE String1 exists or String2 exists or String3 exists")
The text in red!!!, how do I make that search with that chriteria?
Thanks in advance!.
Yorch
Last edited by yorch; Mar 30th, 2007 at 11:42 AM.
Reason: Resolved
-
Mar 27th, 2007, 07:05 PM
#2
Re: String search in Access
The basic syntax is
SELECT * FROM TDOKUMENTE WHERE [somefield] LIKE "*" & String1 & "*"
Hope this helps...
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Mar 28th, 2007, 02:53 AM
#3
Re: String search in Access
You need to use single quotes around your criteria if its a text field.
SELECT * FROM TDOKUMENTE WHERE [somefield] LIKE "'*" & String1 & "*'"
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Mar 30th, 2007, 11:10 AM
#4
Thread Starter
Junior Member
Re: String search in Access
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|