[Qt-interest] Deploying application issue

Yuvaraj R yuvaraj at ongobiz.com
Sat Oct 3 12:25:54 CEST 2009


Hi  I didn't get you.Sorry English is not my first language. Anyhow here i
post my Connection header file source code..

Connection.h

static bool createConnection()

{

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

db.setDatabaseName("Yuvaraj");

db.setUserName("root");

db.setPassword("root");

db.setHostName("192.168.1.237");

db.setPort(3306);

qDebug() << db.isValid();

if (!db.open()) {

QMessageBox::information(0,"Cannot open
database",QString(db.lastError().text()), QMessageBox::Cancel);

return false;

}

return true;

}

main.cpp


#include <QtGui/QApplication>

#include "login.h"

#include "../connection.h"

#include <QSqlDatabase>

#include <QSqlDatabase>

int main(int argc, char *argv[])

{

QApplication a(argc, argv);

if(!createConnection())

{

return 1;

}

login w;

w.show();

return a.exec();

}


Please help me

Thanks.

Yuvaraj R



On Sat, Oct 3, 2009 at 3:47 PM, Alessandro Portale <
Alessandro.Portale at trolltech.com> wrote:

> There must be one code line in your application source code that is
> executed right before that error message appears. Please post that and
> also the 5 prior and following 5 lines (11 in total).
>
> Alessandro
>
> Yuvaraj R schrieb:
> > How do i solve this issue ? With out having mysql server except
> > developer systems?
> >
> > Please Help me
> >
> > Thanks
> >
> > Yuvaraj R
> >
> > On Sat, Oct 3, 2009 at 3:24 PM, Alessandro Portale
> > <Alessandro.Portale at trolltech.com
> > <mailto:Alessandro.Portale at trolltech.com>> wrote:
> >
> >     It could be that there is no mysqlserver on your localhost(10060),
> and
> >     therefore your application is unable to connect to a MySql database.
> >
> >     But, there seem to be possibilities to set the host name and port for
> a
> >     database connection:
> >        http://doc.qt.nokia.com/latest/qsqldatabase.html
> >
> >     Alessandro
> >
> >     Yuvaraj R schrieb:
> >      >      > can't connect to mysqlserver on localhost(10060)
> >      >      > QMYSQL:Unable to connect..
> >      >      > I have libmysql.dll and qsqlmysql.dll in my application
> >     folder..
> >      >      > How do solve this issue?
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091003/e688fddd/attachment.html 


More information about the Qt-interest-old mailing list