My God what in the world I forgot to think of using % which I normally used.
Thanks a lot for shaking my lazy brain =) -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of biruma nandan Sent: Sunday, September 24, 2006 11:25 AM To: [email protected] Subject: Re: [ms_access] SQL Weird Please use % instead of * * is used in Ms Access, % is used in Sql server Regards, Birumanand --- George Oro <[EMAIL PROTECTED]> wrote: > Im trying to use the Like operator to my sql but > can't figure out why giving > me zero result , but if I paste the sql string on > the query it gives me the > exact result? What I've missed here? > > TIA > George > > ==> > Dim cn As ADODB.Connection > Dim rs As ADODB.Recordset > Dim strSQL As String > > Set cn = CurrentProject.Connection > Set rs = New ADODB.Recordset > strSQL = "SELECT * FROM CntTblContacts WHERE > CntFName Like '%ab%'" > Debug.Print strSQL > rs.Open strSQL, cn, adOpenStatic > > MsgBox rs.RecordCount > > rs.Close > cn.Close > Set rs = Nothing > Set cn = Nothing > > > > [Non-text portions of this message have been > removed] > > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Yahoo! Groups Links Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/ms_access/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
