|
-
Aug 25th, 2000, 07:12 AM
#1
Thread Starter
Junior Member
I have a problem using the ADO find method in my VB6 application. I have an ADO Recordset which grabs all records of a table (CUSTOMERS). I used a find method such as ado.recordset.find ("CustomerID = " & CustID & "") and it worked great. However, I overwrote that line with a new find statement that I needed: ado.recordset.find ("CustomerName = " & CustName & "") This time when I run it, I get an error " application using arguments out of range or in conflict with one another". Both the CustName and the CustID variables are inputted by the user using an inputbox method at run time. Basically, it seems to work for numeric and not strings. Any help?
-
Aug 25th, 2000, 07:36 AM
#2
Hi Adam
You could try:-
.Find "CustomerName = " & "'" & CustName & "'"
I seem to remember having a similar problem
some time ago and I think using single quotes
solved it.
Beware though my memory is that if CustName contains
a single quote you will get an error
Regards
SeanR
-
Aug 25th, 2000, 07:38 AM
#3
Frenzied Member
personally i would not use ADO.find
i would find sql to find specific records..
-
Aug 25th, 2000, 07:38 AM
#4
The line above isnt very readable so here it is again
.Find "CustomerName = " & " ' " & CustName & " ' "
-
Aug 25th, 2000, 07:46 AM
#5
Thread Starter
Junior Member
Many thanks SeanR. The single quotes worked great. It's a little unusual that Microsoft doesn't list anything on this little scenario. Thanks again to all who responded.
-
May 18th, 2001, 08:45 AM
#6
New Member
SQL?
I could understand if you wanted to retrieve all records for a particular customer, you would use SQL. But if you are retrieving only one record why wouldn't you use .Find?
Narrowing the recordset with an SQL means that you would then have to requery the recordset to get all the records back. This may not matter on a small database, but what about system and performance on a large database?
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
|