why get me this error about connection to SQL? help plz?
Re: why get me this error about connection to SQL? help plz?
please Help me!!! :confused:
my code :
Code:
#include <QtCore/QCoreApplication>
#include <QtSql>
#include <QDebug>
int main(int argc, char *argv[])
{
QString servername
="HAL//SQLEXPRESS";
db.setConnectOptions();
//QString dsn=QString("DRIVER=(SQL Native Client);SERVER=%1;DATABASE=%2;UID=sa;PWD=").arg(se rverName).arg(dbName);
QString dsn
=QString("DRIVER=(SQL Native Client);SERVER=%1;DATABASE=%2;Trusted_Connection=Y es;").
arg(servername
).
arg(dbname
);
db.setDatabaseName(dsn);
if(db.open())
{
qDebug()<< "opened!";
db.close();
}
else{qDebug()<<"Error="<<db.lastError().text();}
return a.exec();
}
Re: why get me this error about connection to SQL? help plz?
2 Attachment(s)
Re: why get me this error about connection to SQL? help plz?
thankful , But not loaded my Database ??? Why???
Attachment 8937
my database in SQL server 2008 Pictures:
Attachment 8938
thanks...
Re: why get me this error about connection to SQL? help plz?
No idea, some missing odbc libraries, no QODBC driver compiled?
1 Attachment(s)
Re: why get me this error about connection to SQL? help plz?
this is location my database?
I do not know where is the problem?
Attachment 8940
Re: why get me this error about connection to SQL? help plz?
The problem is spelt out plainly in your first screen shot:
Quote:
QSqlDatabase: QODBC driver not loaded
QSqlDatabase: available drivers:
You have no Qt database plugins available to your program. It cannot, therefore, load the QODBC driver you ask for.
If this is your build environment then you need to build the QODBC plugin
If this is a deployed program then you need to deploy the QODBC database plugin in the correct location.
Re: why get me this error about connection to SQL? help plz?
everything is equal standard but i dont know where to put the lines ????
cd %QTDIR%\src\plugins\sqldrivers\odbc
qmake odbc.pro
nmake
Did I just say? thanks...
Re: why get me this error about connection to SQL? help plz?
You need to install the Qt source code for your Qt 4.8.x version if you have not got it already. %QTDIR% refers to the top of the source tree.
The commands need to be typed into a command prompt that is configured for Qt. The Qt SDK puts an icon to launch such a command prompt in the Windows Start menu so use that if you have it. If not, the Qt bin folder containing qmake.exe and the bin folder of your compiler must be on the PATH of a standard command prompt.
1 Attachment(s)
Re: why get me this error about connection to SQL? help plz?
help me : this error is new when my project is Run...
cannot mix incompatible Qt Library<version 0x40704> with this library <version 0x40800>
Attachment 8956
thanks...
if you say Qt 4.7 to Uninstall. I do not know how should I clean it ? can not find the icon 4.7?
Re: why get me this error about connection to SQL? help plz?
You are mixing Qt libraries with different versions -- 4.7.4 and 4.8.0
Re: why get me this error about connection to SQL? help plz?
How do I do this?
How do not mix?
Added after 10 minutes:
How do i do the work that this two version dont mix????
plz help...
Added after 24 minutes:
How do i do the work that this two version dont mix????
plz help...
Re: why get me this error about connection to SQL? help plz?
Quote:
Originally Posted by
complexcoding
How do I do this?
How do not mix?
You check versions of the libraries you are using and replace those from 4.7.4 with those from 4.8.0 or the other way round. If you built your sql plugin against 4.8.0 then you can't use it with 4.7.4 libraries.
Re: why get me this error about connection to SQL? help plz?
This is a clip from Qt installation of my system and Run my project. Please download the File. thanks...
http://www.4shared.com/rar/ILnhLBUe/Qt_online.html
Added after 1 49 minutes:
Please help me!