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. Error in connection of SQL Server in network

Error in connection of SQL Server in network

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 498 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.
  • U Offline
    U Offline
    ulyssesfonseca
    wrote on last edited by
    #1

    I created an application that accesses SQL Server on my machine, and it worked correctly.But when I use a machine on a network, seguite displays the error:

    [Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified QODBC3: unable to connect.

    Already configured the SQL Server installed on the server and the SQL Server Management Studio to test the communication, that is okay.

    the source code:

    db = QSqlDatabase::addDatabase("QODBC");
    dsn = QString("DRIVER={SQL Native Client};SERVER=%1;DATABASE=%2;PORT=1433;UID=cliente;PWD=12345;").arg(servername).arg(dbname);
    db.setDatabaseName(dsn);

    if(db.open){
    }
    else{
    QMessageBox::critical(this,"Erro Conexão!","Não foi possivel realizar a conexão \n com o banco de dados!\n"+db.lastError().text(), "OK");
    }

    What can I do to solve?

    1 Reply Last reply
    0

    • Login

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