Windows QTDS MSSQL connection

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Making described above in Linux connected to the MSSQL through QTDS, Linux, windows downlink not? Sybase, MSSQL is based on TDS protocol in windows, will be able to connect to the database through TDS

 

A compiler plugin for TDS.

Making windows rely only on ntwdblib.lib (MSSQL with) the library, do not need to install the Sybase, can be directly compiled making making

cd %QTDIR%\src\plugins\sqldrivers\tds
qmake "LIBS+=NTWDBLIB.LIB" tds.pro
nmake

 

Two. The test connection

// Note: the Linux code with different, not to the data source name as a parameter
QSqlDatabase db=QSqlDatabase::addDatabase("QTDS");
db.setDatabaseName("sqlscada");
db.setHostName("192.168.10.12\\SQLEXPRESS");  // The host name, because of the use of is the free version, you must include the \SQLEXPRESS suffix. The paid version not, this paper is connected to MSSQL2005
db.setPort(3304);
db.setUserName("sa");
db.setPassword("scada");

if(!db.open())
{
	qDebug("=== %s",qPrintable(db.lastError().text()));
}else
{
	qDebug("==== ok");
}

 

Operation.:

 

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Kay at November 30, 2013 - 7:13 PM