By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

LIKE criteria works in query but not in VB

P: n/a
Jer
I have a query that uses LIKE in the criteria. The criteria I am using
is: LIKE "Program*".
When I look at the query results it works fine.
When I try to open the query as a recordset using
Dim cp_data As Recordset
Set cp_data = New Recordset
cp_data.Open "xxxTEST", CurrentProject.Connection, adOpenStatic,
adLockOptimistic
I don't get any records. ("xxxTEST" is the name of my test query)
What is different using the LIKE criteria from VB vs using it in a
query?

Thanks!

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Jer wrote:
I have a query that uses LIKE in the criteria. The criteria I am
using is: LIKE "Program*".
When I look at the query results it works fine.
When I try to open the query as a recordset using
Dim cp_data As Recordset
Set cp_data = New Recordset
cp_data.Open "xxxTEST", CurrentProject.Connection, adOpenStatic,
adLockOptimistic
I don't get any records. ("xxxTEST" is the name of my test query)
What is different using the LIKE criteria from VB vs using it in a
query?

Thanks!


In ADO the wild card is % instead of *.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.