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. Deploying an application containing database
Forum Updated to NodeBB v4.3 + New Features

Deploying an application containing database

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 4.8k 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.
  • N Offline
    N Offline
    nil_sunil
    wrote on last edited by
    #1

    hi friends ,
    i'm new to qt , so i don know how to deploy an application containing db
    i'm using "QODBC" data base

    1 Reply Last reply
    1
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      Hi, @nil_sunil

      Welcome to Qt Developer Network!

      If you are new at Qt you should read Wiki-pages, here on DevNet and official Qt samples (you can find them in Qt SDK or Qt sources. There are many examples for each Qt module.

      I recommend book "Programming With Qt":http://books.google.com/books/about/Programming_With_Qt.html?id=TjR2G7BXkO8C&redir_esc=y to read. It has many information. And I also recommend book (in russian) - Qt 4.5 Preffesional Programing on C++ (Max Shlee). But it's on russian)).

      In general, you should learn into direction of QtSql module.

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

        I will assume that you know how to build such an application. If not, you should heed tucnak's advice and dive into the docs, examples and some books.

        Your question is not all that clear. You use the ODBC driver, but with what kind of database? Do you actually mean to distribute the database with your application, or do you just wonder how to distribute the driver and other relevant libraries?

        1 Reply Last reply
        1
        • N Offline
          N Offline
          nil_sunil
          wrote on last edited by
          #4

          @andre

          i use Microsoft SQL Server db ..
          i want to distribute data base with my application ..
          i debugged my code in release mode ,attached needed dll's using dependancy walker ..i get proper results when i run exe in my machine
          but when i run the same exe (with required dll's attached ) in any other machine where database is not installed i get only GUI part working .

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

            AFAIK, Microsoft SQL server needs to be installed on the system. It's a big database system that requires far more than just copying some dll's. However, that is outside the scope Qt. Refer to MS SQL Server documentation on how to do this.

            1 Reply Last reply
            1
            • N Offline
              N Offline
              nil_sunil
              wrote on last edited by
              #6

              what if i use derby or some other small db .instead of ms sql .. ?
              when i refered qt site (http://doc.qt.nokia.com/4.7-snapshot/deployment.html) it mentioned creating plugin so i was wondering do i hav to create plugin or something ?

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

                The plugin is only a driver that allows you to connect to a database, not the database (-server) itself.

                Perhaps you should investigate using a small embedded-type database like SqLite or MySql-Embedded. The first is trivial to use with Qt, while the latter is possible if you build the driver manually against the embedded version of MySql.

                1 Reply Last reply
                0
                • N Offline
                  N Offline
                  nil_sunil
                  wrote on last edited by
                  #8

                  @andre thanks a lot .. :) now my code is working on all windows ..
                  but the thing is i have to creat DSN mannually in every system .. is there any way to do it automatically in QT code .. ?

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

                    That would be windows specific. Qt does not provide (direct) API for this specifically. You should search MSDN or something like that for ways to setup DSN's by software. If that requires registry access, you can use [[doc:QSettings]] for that. You can also use win32 API calls directly.

                    1 Reply Last reply
                    1
                    • N Offline
                      N Offline
                      nil_sunil
                      wrote on last edited by
                      #10

                      thank you andre :) it was really helpful .. :)

                      1 Reply Last reply
                      0
                      • N Offline
                        N Offline
                        nil_sunil
                        wrote on last edited by
                        #11

                        can we create dsn dynamically using qt code .. bcoz i'm using my sql server as database in my application and i create dsn mannually .. bt wen i distribute my app it will not find dsn .. unless i create dsn in every machine where i distribute my app ..
                        can anyone help me in solving my prob ??

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

                          [quote author="nil_sunil" date="1341839770"]can we create dsn dynamically using qt code .. bcoz i'm using my sql server as database in my application and i create dsn mannually .. bt wen i distribute my app it will not find dsn .. unless i create dsn in every machine where i distribute my app ..
                          can anyone help me in solving my prob ??[/quote]
                          Merged with your previous topic. Please don't start multiple topics on the same issue.

                          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