Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Searching

jtmuzixjtmuzix Member Posts: 15
I'm using Visual Basic.NET 2003 professional. I am having problems doing a search on an Access database. No matter what I try it's always returning false. I can fill the dataset with an entire table but have had no luck filling it with a specific 'recordset' or return set. I've tried using commandselect.commandtext = "SELECT * FROM [scannerlog] WHERE [Department = & "'cbdep.selecteditem & '" I've tried a lot of different (syntax)variations thinking maybe I am syntactically incorrect. I've also tried a dataview and the .filterrow or .rowfilter function. It doesn't work either. It returns false as well, UNLESS I put in the string department; then it returns true. It's not the specific word 'department' I want to compare, it's THE specific department(i.e. shipping, recieving, HR). If it finds 1 match or 100 matches it SHOULD display all the data in the table relative to the matches it finds. Any code ideas on HOW to search an access database and fill the dataset respectivley would be greatly apperaited.
Thanks,
Jason Tutwiler

Comments

  • jlegjleg Member Posts: 237
    [b][red]This message was edited by jleg at 2004-10-13 18:17:39[/red][/b][hr]
    : I'm using Visual Basic.NET 2003 professional. I am having problems doing a search on an Access database. No matter what I try it's always returning false. I can fill the dataset with an entire table but have had no luck filling it with a specific 'recordset' or return set. I've tried using commandselect.commandtext = "SELECT * FROM [scannerlog] WHERE [Department = & "'cbdep.selecteditem & '" I've tried a lot of different (syntax)variations thinking maybe I am syntactically incorrect. I've also tried a dataview and the .filterrow or .rowfilter function. It doesn't work either. It returns false as well, UNLESS I put in the string department; then it returns true. It's not the specific word 'department' I want to compare, it's THE specific department(i.e. shipping, recieving, HR). If it finds 1 match or 100 matches it SHOULD display all the data in the table relative to the matches it finds. Any code ideas on HOW to search an access database and fill the dataset respectivley would be greatly apperaited.
    : Thanks,
    : Jason Tutwiler
    :
    :
    I think your syntax is incorrect in your Select statement.

    Try something like this:
    "SELECT * FROM [scannerlog] WHERE [Department] = '" & cbdep.selecteditem & "'"

    This should work

    Hope this helps

    John ;-)



Sign In or Register to comment.