Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Godaddy SQL server connection problem
Forum Updated to NodeBB v4.3 + New Features

Godaddy SQL server connection problem

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 1.2k 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.
  • J Offline
    J Offline
    jshadow89
    wrote on 16 Dec 2013, 21:00 last edited by
    #1

    I was playing around with the tutorial for blackberry and wanted to see if I could connect to my web server database.
    bool App::createDatabase()
    {

     // 3. Open a connection to the database, if the database does not exist
     //    one will be created if permitted.
    QSqlDatabase database = QSqlDatabase::addDatabase("QODBC");
    bool success = false;
    
    // 2. Set the path of where the database will be located.
    //    Note: The db extension is not required
    database.setHostName("ABC.db.800.hostedresource.com");
    database.setDatabaseName("ABC
    database.setUserName("ABC")
    database.setPassword("123456!");
    
    // 3. Open a connection to the database, if the database does not exist
    //    one will be created if permitted.
    if (database.open()) {
        alert(tr("Database created/registered."));
        success = true;
    } else {
        // If the database fails to open, error information can be accessed via
        // the lastError function.
        const QSqlError error = database.lastError();
        alert(tr("Error opening connection to the database: %1").arg(error.text()));
    }
    
    // 4. Close the connection to the database.
    //    Be warned, closing the database will invalidate any SqlQuery objects (see below)
    database.close();
    
    return success;
    

    }

    I keep getting a error driver not loaded, I think maybe Godday server doesn't have a supported driver. Any suggestions

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 17 Dec 2013, 22:05 last edited by
      #2

      Hi and welcome to devnet,

      Are you sure that you have the all dependencies required ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      2/2

      17 Dec 2013, 22:05

      • Login

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