Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    A new question about database????

    General and Desktop
    3
    3
    1827
    Loading More Posts
    • 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.
    • M
      master huang last edited by

      my programme writes" QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");"
      QSqlQuery query;
      query.exec(.....);

      now the mistake is:" ...QSqlQuery::exec: database not open" can you solve this question ? thanks

      1 Reply Last reply Reply Quote 0
      • T
        task_struct last edited by

        You should call @ db.open() @ before executing queries.

        "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program."

        • Linu...
        1 Reply Last reply Reply Quote 0
        • A
          andre last edited by

          And you should select an actual database at that. Not just a driver.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post