Results 1 to 9 of 9

Thread: SQLITE ATTACH database

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: SQLITE ATTACH database

    Well, you could use the sql statement
    sql Code:
    1. ATTACH DATABASE filename AS databasename
    To copy to clipboard, switch view to plain text mode 
    then it is pure SQL and has nothing to do with Qt. => You can still use Qt's classes.

    Or you can simply use
    Qt Code:
    1. QSqlDatabase::addDatabase("path/to/file", "mySecondDatabase");
    2. //...
    3. QSqlQuery q(QSqlDatabase::database("mySecondDatabase"));
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to Lykurg for this useful post:

    drescherjm (1st November 2009)

Similar Threads

  1. SQLite sometimes doens't INSERT into database
    By cevou in forum Qt Programming
    Replies: 5
    Last Post: 30th October 2009, 08:10
  2. How can I send a SQLite :memory: database connection ?
    By georgep in forum Qt Programming
    Replies: 4
    Last Post: 20th July 2009, 12:07
  3. Replies: 1
    Last Post: 26th March 2009, 15:25
  4. Replies: 2
    Last Post: 23rd February 2008, 01:58
  5. SQLITE database problems
    By phoenix in forum Newbie
    Replies: 3
    Last Post: 30th April 2007, 21:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.