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

Running LIKE SQL in VB CODE

P: n/a
The Query which is working fine in Queries section but doesn't show any
record while applied through recordset.

the Code fragment is

Set Cn = New ADODB.Connection
AccessConnect = "Data Source='data1'"
Cn.ConnectionString = AccessConnect
Cn.Open
Set rs = Cn.Execute("SELECT * FROM Data WHERE (Data.[Debtor Name])
Like '*" & Debtor_Name1 & "*'")
in this case rs.eof & rs.bof are always true.

Suggest Please ...

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


P: n/a
Like '%' & Debtor_Name1 & '%'

Use % as the wild card character in ADO.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.