CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: VB,Access DB

  1. #1
    Join Date
    Jul 2001
    Posts
    3

    VB,Access DB

    Hi All,

    I posted my question before.But i want to make sure i am posting again same question.
    I want to filter the table that start letter with "T"(Both cases).Below is the query i used in VB.
    strSQL = "SELECT * FROM SubCont WHERE Sub_Cont_Name LIKE '" & "T" & "*'"
    I tested in my Access Query it giving results.
    But when i used in VB,I am getting the recordset.EOF = true.
    So what is the option i have to use to get the correct recordset.

    Thanks,
    CM


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: VB,Access DB

    Try % instead of *
    strSQL = "SELECT * FROM SubCont WHERE Sub_Cont_Name LIKE '" & "T" & "%'"


    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Oct 2001
    Location
    Carmi,IL. USA
    Posts
    30

    Re: VB,Access DB

    You could try this.
    strSQL = "SELECT * FROM SubCont WHERE Sub_Cont_Name LIKE 'T%'"



  4. #4
    Join Date
    Oct 2001
    Posts
    11

    Re: VB,Access DB

    You can also try the below:-

    strSQL = "SELECT * FROM SubCont WHERE Left(Sub_Cont_Name,1) = 'T'"




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured