use of * caracter in rst.Open strSQL

P

phleduc

use of * caracter in rst.Open strSQL
try: strSQL = "SELECT * FROM QrycustomersReport WHERE [cuscompanyName] like
"*test*"
You can use the strSQL to change the recordsource of a form, returns all
company names that include test in their name string.
However when you use the * caracter in an ado statement, the recordset
return no records.
rst.recordcount will always return 0
Any solution for this?

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.Open strSQL

MsgBox rst.RecordCount

rst.Close
Set rst = Nothing
 
G

Guest

Have you tried encapsulating it in SINGLE quotes?

strSQL = "SELECT * FROM QrycustomersReport WHERE [cuscompanyName] like
'*test*'"

--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at http://www.btabdevelopment.com
__________________________________
If my post was helpful to you, please rate the post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top