Visual Basic SQL Statement not working
Posted on 2003-03-22
Here is the statement:
dbMembers.RecordSource = "select * from Members Where Name like 'Lea%'"
I have a table of Members, I want the user to be able to enter a name to search for, and all matches to be displayed on a flexgrid I have in my project bound to this database, unfortunatly while testing with the above lines of code I find it does not work, I have the database and in it under the Name field in the Members table is the name Leanne Stockwell, but the SQL above brings up a blank recordset?
I have even tried replacing 'Lea%' with '%e%' AND STILL I GET A BLANK RECORDSET???
According to every SQL and Visual Basic SQL tutorial I could find the above statement 'should' work, is there something i'm doing wrong here?
I thank you all in advance for any light you can shed on this problem !!
Please note: if I execute the code with just "select * from Members" as the recordsource I get the whole database displayed in the FlexGrid, so I KNOW I havnt done anything wrong with the data control itself.