-
Feb 2nd, 2018, 07:46 AM
#1
Thread Starter
Junior Member
[VB6] Search about Strings using Ado
Hi all
I am working on a program that needs database, I usually use Ado or Data. I see that Ado is more and more Easily. BUT, I need to search in some fields about string data, and I get faults..
I need a way to search using Ado about Strings.
Thanks, Eng27
-
Feb 2nd, 2018, 08:01 AM
#2
Re: [VB6] Search about Strings using Ado
-
Feb 2nd, 2018, 08:17 AM
#3
Thread Starter
Junior Member
Re: [VB6] Search about Strings using Ado
This is my code:
Adodc1.Refresh
Adodc1.RecordSet.Find "Name=" & Text1.Text
.
When I use this code it doesn't work. but when I search in the field id (which contain numeric data) and search about Val(Text1.Text) It works perfectly..
WHY?!
-
Feb 2nd, 2018, 09:38 AM
#4
Re: [VB6] Search about Strings using Ado
See the Database Development FAQs & Tutorials - Database system specific:
http://www.vbforums.com/showthread.p...ed-May-13-2011
-
Feb 2nd, 2018, 09:59 AM
#5
Thread Starter
Junior Member
Re: [VB6] Search about Strings using Ado
Originally Posted by gibra
oh Thanks
-
Feb 2nd, 2018, 04:27 PM
#6
Re: [VB6] Search about Strings using Ado
try
Code:
Adodc1.RecordSet.Find "Name='" & Text1.Text & "'"
string field types need to be enclosed in ' '
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 2nd, 2018, 04:32 PM
#7
Thread Starter
Junior Member
Re: [VB6] Search about Strings using Ado
Originally Posted by westconn1
try
Code:
Adodc1.RecordSet.Find "Name='" & Text1.Text & "'"
string field types need to be enclosed in ' '
Great.. Thanks a lot, this is reasonable..
Tags for this Thread
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
|