none
Filter property in Recordset with LIKE command and wildcards RRS feed

  • Question

  • Hi there.  I have a problem. I need to select records from a table and then filter the results.

    But the filter i'm trying to use is giving me an error

    My filter looks like

    rs.Filter ="(DATA1 LIKE '*123456.abc')

    The problem seems to be with the * at the start of LIKE command.  I can do LIKE '123456.abc' or LIKE '123456.*' with no problems.  I found an article from microsoft (http://msdn.microsoft.com/en-us/library/ms676691.aspx) that seems to indicate i can't do this.  It says i can use the wildcard at the beginning and end of the pattern, or only at the end of the pattern.

    I was thinking i would change my initial SELECT statement that gets the data from the table ... but that isn't working for me either. No errors but no data is coming back either.

    My select statement looks like:

    select * from mytable where DATA1 LIKE '*123456.abc'

    Any suggestions would be appreciated.

    Thanks.

    Friday, April 15, 2011 3:18 PM

All replies

  • There isn't a LIKE command in the windbg tool which is the topic of this forum. 

    I suggest you to visit the forum that discuss the type of the rs variable instead. For example if rs is an ADO.Net data set visit the ADO.Net forums under the Data Platforn Development category.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Friday, April 15, 2011 11:14 PM
  • How about providing an answer? 9 months later and still waiting!
    To err is human, to really balls things up you need Microsoft!
    Thursday, November 24, 2011 10:24 AM
  • That is because this forum is for help for using windbg, which does not support SQL. Try search a database programming forum instead, the answer is likely already there, you are just looking at the wrong place.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Thursday, November 24, 2011 2:42 PM