Results 1 to 5 of 5

Thread: QSQLITE | unable to establish connection

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2006
    Location
    Chennai, India
    Posts
    34
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default QSQLITE | unable to establish connection

    Hi,

    I installed QT 3.3.6

    Tried to establish a connection with SQULITE database. But error messages says like
    "file is encrypted or is not database error to open the database".

    Below is my code.

    Qt Code:
    1. QSqlDatabase *m_db = QSqlDatabase::addDatabase("QSQLITE");
    2. if(!m_db->open())
    3. {
    4. m_db->setHostName( "localhost" );
    5. m_db->setDatabaseName("ResumeDataBase");
    6. m_db->setUserName( "root" );
    7. m_db->setPassword("");
    8. }
    9.  
    10. if ( ! m_db->open( ) )
    11. {
    12. QSqlError l_sqlError = m_db->lastError();
    13. QString l_sqlErrorString = l_sqlError.text();
    14. QMessageBox::information(this, "RTS", l_sqlErrorString);
    15. }
    To copy to clipboard, switch view to plain text mode 

    How to rectify this problem?
    Last edited by jpn; 1st July 2008 at 08:03. Reason: missing [code] tags

Similar Threads

  1. Client/Server Error: BadIDChoice
    By 3nc31 in forum Qt Programming
    Replies: 5
    Last Post: 27th November 2007, 10:22
  2. QSQLITE Unable to fetch row in create
    By xgoan in forum Newbie
    Replies: 3
    Last Post: 18th October 2006, 14:39

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.