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. Application path did not work!
Forum Updated to NodeBB v4.3 + New Features

Application path did not work!

Scheduled Pinned Locked Moved General and Desktop
20 Posts 6 Posters 11.0k Views 1 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.
  • A Offline
    A Offline
    absfrm
    wrote on last edited by
    #11

    [quote author="sierdzio" date="1327921175"]Although that is not related, you should not be invoking "mydb.open()" twice. You can delete one in line 3.[/quote]

    No.this problem was not for this!
    thanks

    If You Want You Can!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #12

      What output do you get if you change your code to:
      @
      QSqlDatabase mydb = QSqlDatabase::addDatabase("QSQLITE");
      QString databasePath = QCoreApplication::applicationDirPath() + "/data/27115";
      qDebug() << "database location:" << databasePath;
      mydb.setDatabaseName(databasePath);
      mydb.open();
      if (mydb.open())
      {
      goview();
      }
      mydb.close();
      }
      @

      Please also tell us what output you expected there.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        absfrm
        wrote on last edited by
        #13

        [quote author="Andre" date="1327922300"]What output do you get if you change your code to:
        @
        QSqlDatabase mydb = QSqlDatabase::addDatabase("QSQLITE");
        QString databasePath = QCoreApplication::applicationDirPath() + "/data/27115";
        qDebug() << "database location:" << databasePath;
        mydb.setDatabaseName(databasePath);
        mydb.open();
        if (mydb.open())
        {
        goview();
        }
        mydb.close();
        }
        @

        Please also tell us what output you expected there.[/quote]
        the output is : @
        database location:C:/Users/MR.Farahmand/Desktop/parsipedia-001-beta-build-desktop/debug/data/27115
        @
        the database address is true but....!!

        If You Want You Can!

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #14

          but what exactly?
          You are sure that the database file really exists at that precise location?

          1 Reply Last reply
          0
          • A Offline
            A Offline
            absfrm
            wrote on last edited by
            #15

            but cant find db file
            i'm copy db file to C:/ location and its working!
            but in
            @
            mydb.setDatabaseName(QCoreApplication::applicationDirPath() + "/data/27115");
            @
            cant connect to db.(maybe cant find db file!)

            If You Want You Can!

            1 Reply Last reply
            0
            • G Offline
              G Offline
              goetz
              wrote on last edited by
              #16

              Can you please write complete sentences? And can you please stop filling in nonsense like "you know" - no, we don't. None of us has a crystal ball here and none of us knows what you're doing and what you're expecting.

              There is nothing like "database address is true" - that's a nonsens statement. We're talking about a path here. That can be valid or not. It can exist or not. But it can neither be true nor false. A bit more precision, please.

              Do you work with an existing database or do you create it at runtime?

              For the former:
              Does that path exist?
              Is it really a file and not a directory?
              Can your read it?
              Is it an sqlite database file?

              For the latter:
              Does your data subdirectory exist?
              If not: create it! Sqlite will not do this for you!

              http://www.catb.org/~esr/faqs/smart-questions.html

              1 Reply Last reply
              0
              • A Offline
                A Offline
                absfrm
                wrote on last edited by
                #17

                thanks
                I fixed it with other ways.

                If You Want You Can!

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Seba84
                  wrote on last edited by
                  #18

                  I don't believe what I see. This post is useless and it was a waste of time for all who participated...

                  Seba84

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    absfrm
                    wrote on last edited by
                    #19

                    Hi to all
                    I'm so sorry for times that you used for this post
                    that's problem was not for db file path
                    web must copy sqldrivers folder to output folder (debug folder neer exe file).
                    [quote author="Seba84" date="1328030127"]I don't believe what I see. This post is useless and it was
                    a waste of time for all who participated...

                    Seba84[/quote]
                    any post can't be useless!!
                    maybe some people have this problem exactly !

                    thanks all

                    If You Want You Can!

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      lgeyer
                      wrote on last edited by
                      #20

                      [quote author="abbas farahmand" date="1328272043"]
                      maybe some people have this problem exactly![/quote]

                      Well, you never posted a solution.

                      You described your problem, we plead for additional information and then
                      [quote author="abbas farahmand" date="1328272043"]
                      I fixed it with other ways.
                      [/quote]

                      So if you want this thread to have any valuable information for others you better hand in what actually solved your problem - what you now did.

                      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