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. Database Connect Problem, Out Of Memory
Qt 6.11 is out! See what's new in the release blog

Database Connect Problem, Out Of Memory

Scheduled Pinned Locked Moved Solved General and Desktop
41 Posts 8 Posters 39.7k Views 4 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.
  • J.HilkJ J.Hilk

    @Taz742
    Also do not use Copy&Paste, ctrl+c /ctrl+v, type it!

    Taz742T Offline
    Taz742T Offline
    Taz742
    wrote on last edited by Taz742
    #9

    @jsulm
    So?

        delete "‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite";
    
        db.setDatabaseName("‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite");
        if(db.open()){
            qDebug() << "db opened";
        }else qDebug() << db.lastError();
    

    So do not work anyway.

    Taz742T jsulmJ 3 Replies Last reply
    0
    • Taz742T Taz742

      @jsulm
      So?

          delete "‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite";
      
          db.setDatabaseName("‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite");
          if(db.open()){
              qDebug() << "db opened";
          }else qDebug() << db.lastError();
      

      So do not work anyway.

      Taz742T Offline
      Taz742T Offline
      Taz742
      wrote on last edited by Taz742
      #10
      This post is deleted!
      1 Reply Last reply
      0
      • Taz742T Taz742

        @jsulm
        So?

            delete "‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite";
        
            db.setDatabaseName("‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite");
            if(db.open()){
                qDebug() << "db opened";
            }else qDebug() << db.lastError();
        

        So do not work anyway.

        Taz742T Offline
        Taz742T Offline
        Taz742
        wrote on last edited by
        #11

        @Taz742
        this problem not solved. i randomly select correct answer.

        sierdzioS 1 Reply Last reply
        0
        • Taz742T Taz742

          @Taz742
          this problem not solved. i randomly select correct answer.

          sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #12

          @Taz742 I've moved it back to unsolved state. Good luck :-)

          (Z(:^

          1 Reply Last reply
          2
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #13

            Do you still have an error similar to QSqlError("-1", "Error opening database", "out of memory") "\u202AC:/Users/User/Desktop/newdata.db" ?

            The \u202A is important here. It's likely the source of your problem since with it, the path points to an invalid location. So what was suggested was to delete the line of code containing the setDatabaseName call and rewrite it completely (i.e. without copy/paste) to ensure there's no funky character in it.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • Taz742T Taz742

              @jsulm
              So?

                  delete "‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite";
              
                  db.setDatabaseName("‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite");
                  if(db.open()){
                      qDebug() << "db opened";
                  }else qDebug() << db.lastError();
              

              So do not work anyway.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #14

              @Taz742 "So do not work anyway" - what is the error message now?

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              Taz742T 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Taz742 "So do not work anyway" - what is the error message now?

                Taz742T Offline
                Taz742T Offline
                Taz742
                wrote on last edited by
                #15

                @jsulm
                The same error

                mrjjM Taz742T 2 Replies Last reply
                0
                • Taz742T Taz742

                  @jsulm
                  The same error

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #16

                  @Taz742
                  Hi
                  Could you perhaps open the DB in
                  http://sqlitebrowser.org/
                  and see what it says ?

                  If its not the ""\u202A" char that gives this, then it could be great to see if other sqllite
                  program loads it without any errors.

                  Taz742T 1 Reply Last reply
                  0
                  • Taz742T Taz742

                    @jsulm
                    The same error

                    Taz742T Offline
                    Taz742T Offline
                    Taz742
                    wrote on last edited by
                    #17

                    @Taz742
                    Yes same error.
                    When I saw this problem for the first time, it happened while I was server (the server I'm working on a project RDP) I copied down the entire project on my computer. After "QSqlError (" - 1 "," Error opening database "," out of memory ")" \ u202AC: /Users/User/Desktop/newdata.db ", this problem has emerged in both the server and my computer, when an application started .

                    1 Reply Last reply
                    0
                    • mrjjM mrjj

                      @Taz742
                      Hi
                      Could you perhaps open the DB in
                      http://sqlitebrowser.org/
                      and see what it says ?

                      If its not the ""\u202A" char that gives this, then it could be great to see if other sqllite
                      program loads it without any errors.

                      Taz742T Offline
                      Taz742T Offline
                      Taz742
                      wrote on last edited by
                      #18

                      @mrjj
                      I have not seen any hacking \ u202A problem. :/

                      mrjjM 1 Reply Last reply
                      0
                      • Taz742T Taz742

                        @mrjj
                        I have not seen any hacking \ u202A problem. :/

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by mrjj
                        #19

                        @Taz742
                        and what did SQLBrowser say?

                        Update:
                        This error can come from things NOT related to memory at all. it seems
                        http://servalpaul.blogspot.dk/2011/12/misleading-out-of-memory-error-in.html

                        the_T 1 Reply Last reply
                        0
                        • mrjjM mrjj

                          @Taz742
                          and what did SQLBrowser say?

                          Update:
                          This error can come from things NOT related to memory at all. it seems
                          http://servalpaul.blogspot.dk/2011/12/misleading-out-of-memory-error-in.html

                          the_T Offline
                          the_T Offline
                          the_
                          wrote on last edited by
                          #20

                          @mrjj
                          In most cases it has to do with write permissions. Had the same error when trying to create a sqlite database in a location with no write access for the user.

                          -- No support in PM --

                          mrjjM 1 Reply Last reply
                          1
                          • the_T the_

                            @mrjj
                            In most cases it has to do with write permissions. Had the same error when trying to create a sqlite database in a location with no write access for the user.

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on last edited by
                            #21

                            @the_
                            Good info.
                            So in any case its misleading as hell :)

                            the_T 1 Reply Last reply
                            0
                            • mrjjM mrjj

                              @the_
                              Good info.
                              So in any case its misleading as hell :)

                              the_T Offline
                              the_T Offline
                              the_
                              wrote on last edited by
                              #22

                              @mrjj
                              this was my first guess here too.

                              @Taz742
                              does the db file exist when you start your program? if yes, can you access it using QFile with the given path, try to open(QFile::ReadOnly) and read it? (would be binary content only)

                              -- No support in PM --

                              Taz742T 1 Reply Last reply
                              1
                              • the_T the_

                                @mrjj
                                this was my first guess here too.

                                @Taz742
                                does the db file exist when you start your program? if yes, can you access it using QFile with the given path, try to open(QFile::ReadOnly) and read it? (would be binary content only)

                                Taz742T Offline
                                Taz742T Offline
                                Taz742
                                wrote on last edited by
                                #23

                                @the_
                                alt text
                                Did you see the file in the address really exists?
                                And answer Is:

                                    db = QSqlDatabase::addDatabase("QSQLITE");
                                
                                    db.setDatabaseName("‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite");
                                    if(db.open()){
                                        qDebug() << "db opened";
                                    }
                                    else
                                        qDebug() << db.lastError();
                                
                                    QString paths = "‪C:/Users/tleladze/Desktop/valuta/dbbb.sqlite";
                                
                                    QFile* file = new QFile(paths);
                                
                                    if(!file->open(QIODevice::ReadOnly)){
                                        qDebug() << "Filed To Open";
                                    }
                                
                                QSqlError("-1", "Error opening database", "out of memory")
                                Filed To Open
                                
                                1 Reply Last reply
                                0
                                • VRoninV Offline
                                  VRoninV Offline
                                  VRonin
                                  wrote on last edited by
                                  #24

                                  Could you move the database somewhere less controversial like C:/Temp/valuta and try if it works there?

                                  "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
                                  ~Napoleon Bonaparte

                                  On a crusade to banish setIndexWidget() from the holy land of Qt

                                  Taz742T 1 Reply Last reply
                                  1
                                  • VRoninV VRonin

                                    Could you move the database somewhere less controversial like C:/Temp/valuta and try if it works there?

                                    Taz742T Offline
                                    Taz742T Offline
                                    Taz742
                                    wrote on last edited by
                                    #25

                                    @VRonin
                                    No. Nothing :/

                                    1 Reply Last reply
                                    0
                                    • SGaistS Offline
                                      SGaistS Offline
                                      SGaist
                                      Lifetime Qt Champion
                                      wrote on last edited by
                                      #26

                                      What size is that database ?

                                      Interested in AI ? www.idiap.ch
                                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                      Taz742T 1 Reply Last reply
                                      1
                                      • SGaistS SGaist

                                        What size is that database ?

                                        Taz742T Offline
                                        Taz742T Offline
                                        Taz742
                                        wrote on last edited by
                                        #27

                                        @SGaist
                                        448KB

                                        1 Reply Last reply
                                        0
                                        • SGaistS Offline
                                          SGaistS Offline
                                          SGaist
                                          Lifetime Qt Champion
                                          wrote on last edited by
                                          #28

                                          Is it encrypted ?

                                          Interested in AI ? www.idiap.ch
                                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                          Taz742T 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