Results 1 to 4 of 4

Thread: Questions about connect to remote database

  1. #1
    Join Date
    Oct 2010
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Questions about connect to remote database

    i try the following code on my own computer, it can access to the database (the database on my own computer).

    However, when i run this code on another computer, it cannot access to the database which is located on my computer


    xxx.xxx.xxx.xx is the ip address of my own computer (which launch the MSSQL)

    i try whole days, but still no idea :/
    can anyone give me some suggestions?
    Thank you very much!

    QString serverName = "xxx.xxx.xxx.xx\\SQLEXPRESS";
    QString dbName = "myDB";
    QString dbID = "sa";
    QString dbPW = "abcd";

    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");
    QString dsn = QString("DRIVER={SQL Server Native Client 10.0};SERVER=%1;DATABASE=%2;UID=%3;PWD=%4;").arg(s erverName).arg(dbName).arg(dbID).arg(dbPW);

    db.setDatabaseName(dsn);

  2. #2
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,453
    Thanked 271 Times in 266 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Questions about connect to remote database

    Maybe firewall on Yours computer blocks MS SQL ports off.

  3. #3
    Join Date
    Oct 2010
    Posts
    11
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Questions about connect to remote database

    thanks for your reply.

    so, my program setting is correct?

    it is possible to access to the remote database by qt programming?

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Questions about connect to remote database

    Quote Originally Posted by stmk View Post
    it is possible to access to the remote database by qt programming?
    I already answered you that in the other post on this same forum asking the exact same question!
    The problem is you, you do not understand what you're doing. I suggest you read as much as you can about the subject.

Similar Threads

  1. can qt access remote database?
    By stmk in forum Newbie
    Replies: 5
    Last Post: 5th November 2012, 17:52
  2. Replies: 2
    Last Post: 15th April 2010, 14:59
  3. Problem connecting to remote database
    By graciano in forum Qt Programming
    Replies: 2
    Last Post: 16th April 2009, 10:59
  4. qobject connect questions
    By VireX in forum Newbie
    Replies: 5
    Last Post: 20th May 2007, 09:04
  5. Replies: 5
    Last Post: 28th August 2006, 14:36

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.