Connecting Tech Pros Worldwide Help | Site Map

Running LIKE SQL in VB CODE

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 02:57 PM
vanita_kalambe@rediffmail.com
Guest
 
Posts: n/a
Default Running LIKE SQL in VB CODE

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 ...


  #2  
Old November 13th, 2005, 02:57 PM
lylefair
Guest
 
Posts: n/a
Default Re: Running LIKE SQL in VB CODE

Like '%' & Debtor_Name1 & '%'

Use % as the wild card character in ADO.

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.