Hello friends,
I am developing small database application with database MySql , actually database installed in remote system. I want to access database file example test.db from that remote system. I wrote the following lines in my application , but receive error .
i.e can’t create TCP/IP socket (10093)QMYSQL:unable to connect.
db1.setHostName(“ Remote system ip address “);
db1.setDatabaseName("test.db");
db1.setUserName("root");
db1.setPassword(NULL);
if(db1.open())
else
QSqlDatabase db1=QSqlDatabase::addDatabase("QMYSQL");
db1.setHostName(“ Remote system ip address “);
db1.setDatabaseName("test.db");
db1.setUserName("root");
db1.setPassword(NULL);
if(db1.open())
QMessageBox::information(0,"DB","Access");
else
QMessageBox::warning(0,"DB","Not open");
QSqlError err=db1.lastError();
QString str=err.text();
To copy to clipboard, switch view to plain text mode
How to make connection with database ?
tool: Qt 4.1
OS :Windows XP
IDE : VC++.NET
Bookmarks