Results 1 to 3 of 3

Thread: Connection with MySql

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2006
    Location
    Coimbatore,India
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Thumbs up Connection with MySql

    Hello friends,

    I am developing small database application with database MySql , actually database installed in remote system. I want to access database file example test.db from that remote system. I wrote the following lines in my application , but receive error .
    i.e can’t create TCP/IP socket (10093)QMYSQL:unable to connect.

    Qt Code:
    1. QSqlDatabase db1=QSqlDatabase::addDatabase("QMYSQL");
    2. db1.setHostName(“ Remote system ip address “);
    3. db1.setDatabaseName("test.db");
    4. db1.setUserName("root");
    5. db1.setPassword(NULL);
    6.  
    7. if(db1.open())
    8. QMessageBox::information(0,"DB","Access");
    9. else
    10. QMessageBox::warning(0,"DB","Not open");
    11. QSqlError err=db1.lastError();
    12. QString str=err.text();
    To copy to clipboard, switch view to plain text mode 

    How to make connection with database ?
    tool: Qt 4.1
    OS :Windows XP
    IDE : VC++.NET
    Last edited by wysota; 31st July 2006 at 09:41. Reason: Added [code] tags
    Vichu

Similar Threads

  1. connecting to MySQL through it's API
    By Philip_Anselmo in forum Installation and Deployment
    Replies: 20
    Last Post: 30th May 2006, 23:22
  2. How do I keep the client connection open ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 25th March 2006, 19:06
  3. using Mysql: Ca't create TCP/IP socket
    By blackliteon in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2006, 18:25
  4. Can I launch a dial-up connection in Windows?
    By gtthang in forum Qt Programming
    Replies: 3
    Last Post: 9th February 2006, 12:32
  5. Qt 4.1 OS on Windows & mysql
    By neeko in forum Installation and Deployment
    Replies: 10
    Last Post: 31st January 2006, 20:22

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.