|
-
May 9th, 2009, 02:19 PM
#1
Thread Starter
Lively Member
[RESOLVED] whats the error in the sql statment code?
Hi
whats the error in the sql statment code?
Code:
Adodc1.RecordSource = "select * from recept_Query where cheq_num like'" & Text8.Text & "' and where rec_type like'" & Text7.Text & "'"
ineed to make to condition in one selec statment like tha code?
thank yo
-
May 9th, 2009, 02:27 PM
#2
Re: whats the error in the sql statment code?
The keyword Where appears twice, once is enough.
-
May 9th, 2009, 02:31 PM
#3
Re: whats the error in the sql statment code?
You also dont have the LIKE wildcard character ("%") in your sql string unless you plan on adding it to the textbox input manually.
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 
-
May 9th, 2009, 02:31 PM
#4
Thread Starter
Lively Member
Re: whats the error in the sql statment code?
no ineed to check too fields in one time
-
May 9th, 2009, 02:32 PM
#5
Re: whats the error in the sql statment code?
 Originally Posted by iyadd
no ineed to check too fields in one time
You can have multiple fields in your where clause
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 
-
May 9th, 2009, 02:33 PM
#6
Thread Starter
Lively Member
Re: whats the error in the sql statment code?
-
May 9th, 2009, 02:42 PM
#7
Re: whats the error in the sql statment code?
Code:
SELECT * FROM Table1 WHERE Field1 LIKE '%blah%' AND Field2 LIKE '%stuff%'
The corrected code for the posted question is ...
Code:
Adodc1.RecordSource = "select * from recept_Query where cheq_num like '%" & Text8.Text & "%' and rec_type like '%" & Text7.Text & "%'"
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 
-
May 9th, 2009, 10:38 PM
#8
Thread Starter
Lively Member
Re: whats the error in the sql statment code?
RobDog888 THanks you very much......its correct and run succefully.....
thank you too
iyadd
-
May 10th, 2009, 01:05 PM
#9
Re: whats the error in the sql statment code?
No prob. Glad to help 
Ps, dont forget to Resolve your thread fromt he Thread Tools menu and choose "Mark Thread as Resolved"
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 
-
May 10th, 2009, 02:11 PM
#10
Thread Starter
Lively Member
Re: [RESOLVED] whats the error in the sql statment code?
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
|