Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: Database Drivers Related to Qt

  1. #21
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Database Drivers Related to Qt

    Dear Wysota,

    I have done with Postgresql..........But having a problem with ODBC not knowing how to do it........Can you just help me out the way that you done for rest of the databases...........Thanks in advance......Any solution would be appreciable.......

    Regards,

  2. #22
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Database Drivers Related to Qt

    Is there any reason why you are trying all the database plugins?

    For ODBC install appropriate packages for your system just like I have shown you for PostgreSQL.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #23
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Database Drivers Related to Qt

    Dear Wysota,

    Thanks for the reply........Can you send me the same steps for ODBC like the way you sent me for PSQL ......I mean the commands that you sent me right similarly the same way can you give me in the form of step wise......Thanks in advance..........Any solution would be appreciable.....

    Regards,

  4. #24
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    29
    Thanked 50 Times in 47 Posts

    Default Re: Database Drivers Related to Qt

    sudo apt-get install libqt4-sql-odbc

    or download it from here:-

    http://pkgs.org/download/libqt4-sql-odbc
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

  5. #25
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Database Drivers Related to Qt

    Dear Wysota,

    Thanks for the reply......As you gave me a link to find out right but im not knowing what this link will helpout me..I need to build drivers right for ODBC ....Can you give me in brief how do i run in Terminal of Ubuntu....That would be helpful......Thanks in advance....Any Solution would be appreciable....
    http://www.lmgtfy.com?q=apt-get+ubuntu

    Regards,

  6. #26
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Database Drivers Related to Qt

    Quote Originally Posted by StarRocks View Post
    I need to build drivers right for ODBC ....
    No, you don't.

    Can you give me in brief how do i run in Terminal of Ubuntu
    That's not a "I'm a Ubuntu luser, help me" forum. That's a Qt forum. To learn to use Linux, go to some other forum like www.linuxquestions.org
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #27
    Join Date
    Jul 2012
    Location
    Hyderabad
    Posts
    82
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11
    Thanks
    5

    Default Re: Database Drivers Related to Qt

    Dear Wysota,


    Thanks for the reply..........I have builded Odbc driver,but when i run my program i am getting the following error message as " [unixODBC][Driver Manager]Data source name not found, and no default driver specified QODBC3: Unable to connect" ....I am not sure whether my program is wrong or the connection that i gave is wrong correct me if my program is wrong please find the code given below.........Thanks in Advance............Any solution would be appreciable.........



    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QTableWidget>
    #include <QSqlDatabase>
    #include <QMessageBox>
    #include <qdebug.h>
    #include <QtSql>

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);

    qDebug()<<"Im Venu-------------------------------";
    QTableWidget* table = new QTableWidget();
    table->setWindowTitle("Connect to Mysql Database Example");

    qDebug()<<"Im coming Back to Rock";

    // qDebug()<<"Im Waiting for the Value"<<app.libraryPaths();

    QSqlDatabase db = QSqlDatabase::addDatabase("QODBC");

    // db.setDatabaseName("Data Source=192.168.1.73,1433;Network Library=DBMSSOCN;"
    // );


    db.setHostName("192.168.1.73");
    db.setDatabaseName("Test");
    db.setUserName("sa");
    db.setPassword("sa@123");


    // db.setDatabaseName( "Test" );
    // db.setUserName( "sa" );
    // db.setPassword( "sa@123" );
    // db.setHostName( "192.168.1.73" );

    // db.setHostName("localhost");
    // db.setDatabaseName("test");
    // db.setUserName("venugopal");
    // db.setPassword("admin");

    qDebug()<<db.drivers()<<"Lemme speak something";
    if (!db.open())
    {
    QMessageBox::critical(0, QObject::tr("Database Error"),
    db.lastError().text());
    }

    QSqlQuery query;
    bool a= query.exec("SELECT * FROM Employee");
    qDebug()<<a<<"111111111111111111111111111111111111111111111";

    table->setColumnCount(query.record().count());
    table->setRowCount(query.size());

    int index=0;
    while (query.next())
    {
    table->setItem(index,0,new QTableWidgetItem(query.value(0).toString()));
    table->setItem(index,1,new QTableWidgetItem(query.value(1).toString()));
    index++;
    }

    table->show();

    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    void MainWindow::changeEvent(QEvent *e)
    {
    QMainWindow::changeEvent(e);



    switch (e->type()) {
    case QEvent::LanguageChange:
    ui->retranslateUi(this);
    break;
    default:
    break;

    }
    }




    Regards,

  8. #28
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Database Drivers Related to Qt

    Definitely your database name is wrong. It should comply to ODBC standards of choosing the data source.

    For the QODBC driver, the name can either be a DSN, a DSN filename (in which case the file must have a .dsn extension), or a connection string.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Database drivers missing
    By EvIL_GuY in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2012, 23:00
  2. Replies: 1
    Last Post: 9th January 2012, 00:23
  3. how to install DataBase Drivers
    By un9tsandeep in forum Qt Programming
    Replies: 2
    Last Post: 4th October 2011, 12:44
  4. LGPL and distributing QT database drivers
    By BitRogue in forum General Discussion
    Replies: 4
    Last Post: 7th July 2011, 09:32
  5. database drivers - installation
    By banita in forum Qt Programming
    Replies: 5
    Last Post: 29th April 2010, 19:26

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.