hi everyone ,
I want to connect remotely to ms sql server through an application.For this ODBC is required.
I followed the following lines:
It is recommended that you use unixODBC. You can find the latest version and ODBC drivers at http://www.unixodbc.org. You need the unixODBC header files and shared libraries.
Tell qmake where to find the unixODBC header files and shared libraries (here it is assumed that unixODBC is installed in /usr/local/unixODBC) and run make:
cd $QTDIR/src/plugins/sqldrivers/odbc
qmake "INCLUDEPATH+=/usr/local/unixODBC/include" "LIBS+=-L/usr/local/unixODBC/lib -lodbc"
make
It is recommended that you use unixODBC. You can find the latest version and ODBC drivers at http://www.unixodbc.org. You need the unixODBC header files and shared libraries.
Tell qmake where to find the unixODBC header files and shared libraries (here it is assumed that unixODBC is installed in /usr/local/unixODBC) and run make:
cd $QTDIR/src/plugins/sqldrivers/odbc
qmake "INCLUDEPATH+=/usr/local/unixODBC/include" "LIBS+=-L/usr/local/unixODBC/lib -lodbc"
make
To copy to clipboard, switch view to plain text mode
But i am getting an error :- QSqlDatabase: QODBC driver not loaded
My pc is linux 64 bit (fedora -11).I am using qt 4.6.
My code is :
QString conn
= QString::fromLocal8Bit("DRIVER={SQL SERVER};SERVER=192.168.10.82\\SQLExpress;DATABASE=master;Uid=sa;Pwd=[]");
db.setDatabaseName(conn);
db.setUserName("essl");
db.setPassword("essl");
bool flag = db.open();
QString conn = QString::fromLocal8Bit("DRIVER={SQL SERVER};SERVER=192.168.10.82\\SQLExpress;DATABASE=master;Uid=sa;Pwd=[]");
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", "MainDBConnection");
db.setDatabaseName(conn);
db.setUserName("essl");
db.setPassword("essl");
bool flag = db.open();
To copy to clipboard, switch view to plain text mode
plz tell me how to connect with server .
Is there anything extra to add plugin .
or a odbc driver is required
Bookmarks