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

Database Connect Problem, Out Of Memory

Scheduled Pinned Locked Moved Solved General and Desktop
41 Posts 8 Posters 17.2k 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.
  • Taz742T Offline
    Taz742T Offline
    Taz742
    wrote on last edited by Taz742
    #1

    Hello all.

        db = QSqlDatabase::addDatabase("QSQLITE");
        db.setDatabaseName("‪C:/Users/User/Desktop/newdata.db");
        if(db.open()){
            qDebug() << "db opened";
        }else qDebug() << db.lastError() << db.databaseName();
    
    QSqlError("-1", "Error opening database", "out of memory") "\u202AC:/Users/User/Desktop/newdata.db"
    QSqlQuery::prepare: database not open
    
    the_T 1 Reply Last reply
    0
    • Taz742T Taz742

      Hello all.

          db = QSqlDatabase::addDatabase("QSQLITE");
          db.setDatabaseName("‪C:/Users/User/Desktop/newdata.db");
          if(db.open()){
              qDebug() << "db opened";
          }else qDebug() << db.lastError() << db.databaseName();
      
      QSqlError("-1", "Error opening database", "out of memory") "\u202AC:/Users/User/Desktop/newdata.db"
      QSqlQuery::prepare: database not open
      
      the_T Offline
      the_T Offline
      the_
      wrote on last edited by the_
      #2

      @Taz742
      Does the user who starts the program have write access to the desktop of the user User?

      ---- edit

      Do you have any idea where the LTR byte comes from when you read back and debug the database name? Have you set any left-to-right somewhere in the code?

      -- No support in PM --

      Taz742T 2 Replies Last reply
      0
      • the_T the_

        @Taz742
        Does the user who starts the program have write access to the desktop of the user User?

        ---- edit

        Do you have any idea where the LTR byte comes from when you read back and debug the database name? Have you set any left-to-right somewhere in the code?

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

        @the_
        Yes, I have all access.
        I noticed nothing, had previously worked on the same project, But now I can not get what happened.

        1 Reply Last reply
        0
        • the_T the_

          @Taz742
          Does the user who starts the program have write access to the desktop of the user User?

          ---- edit

          Do you have any idea where the LTR byte comes from when you read back and debug the database name? Have you set any left-to-right somewhere in the code?

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

          @the_
          Now I reload my program and everything is corrected.
          Unfortunately I could not find the error.

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

            Hi,

            There's something fishy in your database name. It looks likes there's an invisible character before the C:. You should erase and rewrite that line completely.

            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

              Hi,

              There's something fishy in your database name. It looks likes there's an invisible character before the C:. You should erase and rewrite that line completely.

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

              @SGaist
              I do not understand where to delete.
              When I did a new database, i got to do the same Error.

              jsulmJ 1 Reply Last reply
              0
              • Taz742T Taz742

                @SGaist
                I do not understand where to delete.
                When I did a new database, i got to do the same Error.

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

                @Taz742 In

                db.setDatabaseName("‪C:/Users/User/Desktop/newdata.db");
                

                delete "‪C:/Users/User/Desktop/newdata.db" and enter it again...

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

                1 Reply Last reply
                0
                • J.HilkJ Offline
                  J.HilkJ Offline
                  J.Hilk
                  Moderators
                  wrote on last edited by
                  #8

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


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  Taz742T 1 Reply Last reply
                  0
                  • 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

                                          • Login

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