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. Could it be possible to have two different connections to handle two different databases?
Forum Updated to NodeBB v4.3 + New Features

Could it be possible to have two different connections to handle two different databases?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.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.
  • P Offline
    P Offline
    pico
    wrote on 11 Jan 2011, 06:33 last edited by
    #1

    Hi, Sir:
    I use QSqliteDatabase to addDatabse for two different files, however, it always show me "driver not loaded".
    Could anyone teach me how to have two databases simultaneously?

    PS: I don't use "attach" way because I need to handle them as two different connections.

    Thanks a lot.

    BR,
    Pico

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on 11 Jan 2011, 09:24 last edited by
      #2

      Let me get this straight: you have no problems using a single SQLite database connection, but you can not make a second one work?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on 11 Jan 2011, 11:20 last edited by
        #3

        You can call addDatabase() twice; just be sure to give different connection names in the two calls. In subsequent calls to QSqlDatabase::database() put the name of the desired connection to the argument list.

        For your errors: Show us some code please, we cannot guess what you are doing.

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

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pico
          wrote on 11 Jan 2011, 13:22 last edited by
          #4

          Hi, All:
          Thanks a lot. I just follow your recommendation, and it works now.

          Thanks again...

          1 Reply Last reply
          0

          1/4

          11 Jan 2011, 06:33

          • Login

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