Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSqlQuery for ms access database
Forum Updated to NodeBB v4.3 + New Features

QSqlQuery for ms access database

Scheduled Pinned Locked Moved Solved General and Desktop
24 Posts 4 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS SGaist

    @behruz-montazeri said in QSqlQuery for ms access database:

    @sgaist
    I have no idea.

    Something like "SELECT * FROM names where name like '%foo%'" to confirm that one is working properly.

    behruz montazeriB Offline
    behruz montazeriB Offline
    behruz montazeri
    wrote on last edited by behruz montazeri
    #21

    @sgaist
    Yes that works.Then what should be inside the % % instead of foo for binding ???
    what about binding ??

    1 Reply Last reply
    0
    • RonaldViscarraLR Offline
      RonaldViscarraLR Offline
      RonaldViscarraL
      wrote on last edited by
      #22

      try this:

      QSqlQuery  query ;
      query.prepare("SELECT * FROM names where name like '%?%'" );
      query.addBindValue("a");
      
      1 Reply Last reply
      0
      • RonaldViscarraLR Offline
        RonaldViscarraLR Offline
        RonaldViscarraL
        wrote on last edited by
        #23

        I tested in Qt using access both 32 bits, this code works for me:

        QString st = "a";
        query->prepare("SELECT * FROM names WHERE name LIKE ?;");
        
        QString criteria("%" + st + "%");
        query->addBindValue(criteria);
        
        behruz montazeriB 1 Reply Last reply
        1
        • RonaldViscarraLR RonaldViscarraL

          I tested in Qt using access both 32 bits, this code works for me:

          QString st = "a";
          query->prepare("SELECT * FROM names WHERE name LIKE ?;");
          
          QString criteria("%" + st + "%");
          query->addBindValue(criteria);
          
          behruz montazeriB Offline
          behruz montazeriB Offline
          behruz montazeri
          wrote on last edited by
          #24

          @ronaldviscarral
          Thank you very much it works now.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved