Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Sql-delete works only in Simulator
QtWS25 Last Chance

Sql-delete works only in Simulator

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 2.7k Views
  • 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 Offline
    M Offline
    Matze5590
    wrote on last edited by
    #1

    Hello,

    i have a sqlite database in my project. alle the data in the database is shown in a QTableView.
    When i select a row and press a "delete"-Button this row should be deleted.
    everything works fine with Simulator, but on device(Nokia N8) nothing happens.
    Any idea why?

    Here my code:
    @QTextStream(&str_del) << "DELETE FROM Table WHERE ID = " << index.row() << ";";
    if (query_ges.exec(str_del) == false){
    QSqlError err = query_ges.lastError();
    if (err.number() != 1){
    QMessageBox::warning(this, "Error", err.text(), "Ok");
    }@
    When i debug the Statement looks like that:
    "DELETE FROM Table WHERE ID = 1;"
    and no error occures.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Matze5590
      wrote on last edited by
      #2

      i dont know why, but when i set the ID as "NOT NULL PRIMARY KEY" everything works fine, also on device!

      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