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. Why does it show me this Error when saving backup, in Qt and sqlite3
Forum Updated to NodeBB v4.3 + New Features

Why does it show me this Error when saving backup, in Qt and sqlite3

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 217 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.
  • lincolnL Offline
    lincolnL Offline
    lincoln
    wrote on last edited by
    #1

    I have the following code, I want to save a backup from Qt using the sqlite .backup command, but it shows me this error, and the file is not created.

    9d789786-8c3e-4a66-aaca-0b8b0fca00ff-image.png

    QObject::connect(ui->actionHacer_backup, &QAction::triggered, this, [&](){
          QProcess process;
          QStringList argv{};
          QString app{"sqlite3.exe"};
          auto db = qApp->applicationDirPath().append("/xxxdatabase/xdatabase.db");
          auto file_savePath = QFileDialog::getSaveFileName(this, "save a backup",QDir::rootPath(),
                                                            "Archivo backup (*.bak)");
         
          if(file_savePath.isEmpty())
            return;
    
          argv << db << ".backup" << file_savePath;
          if(process.startDetached(app, argv)){
              qInfo() << "Backup creado!!";
            }
    
    
    
        });
    

    Any recommendation would be good.

    Solitary wolf

    Christian EhrlicherC 1 Reply Last reply
    0
    • lincolnL lincoln

      I have the following code, I want to save a backup from Qt using the sqlite .backup command, but it shows me this error, and the file is not created.

      9d789786-8c3e-4a66-aaca-0b8b0fca00ff-image.png

      QObject::connect(ui->actionHacer_backup, &QAction::triggered, this, [&](){
            QProcess process;
            QStringList argv{};
            QString app{"sqlite3.exe"};
            auto db = qApp->applicationDirPath().append("/xxxdatabase/xdatabase.db");
            auto file_savePath = QFileDialog::getSaveFileName(this, "save a backup",QDir::rootPath(),
                                                              "Archivo backup (*.bak)");
           
            if(file_savePath.isEmpty())
              return;
      
            argv << db << ".backup" << file_savePath;
            if(process.startDetached(app, argv)){
                qInfo() << "Backup creado!!";
              }
      
      
      
          });
      

      Any recommendation would be good.

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Because according to so it's sqlite3 test.db ".backup backup.db" and not sqlite3 test.db .backup backup.db

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      lincolnL 1 Reply Last reply
      3
      • lincolnL lincoln has marked this topic as solved on
      • Christian EhrlicherC Christian Ehrlicher

        Because according to so it's sqlite3 test.db ".backup backup.db" and not sqlite3 test.db .backup backup.db

        lincolnL Offline
        lincolnL Offline
        lincoln
        wrote on last edited by
        #3

        @Christian-Ehrlicher Thanks

        Solitary wolf

        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