Connect To sqlServer Database Problem
-
Hi,
Might be a silly question but, are you sure you have the driver QODBC availalbe.
-
@SGaist
what you error caught during execution? -
@Vicky-Sharma
Just Show my Message in IF CONDITION that show "fail"!
and my ODBC Drivers Already Installed. -
Rather than fail you should print the content of QSqlDatabase::lastError.
-
@SGaist
@Vicky-Sharma
Thanks
this is my Error
http://8pic.ir/images/kab0zjxk7ytw9yao2rxe.png
What i must do Exactly ? -
As silly as it may sound, fix the problem described by the message. Either your server is not accessible e.g. doesn't run or you can't access it because of missing credentials.
-
@hskoglund
Thanks
i Replaced that ip But Showed Me This Message
ERROR
Sql Server -
Aha, ok, then instead try specify your name and password:
QString dsn="DRIVER=SQL Server;Server=LocalHost;Database=Test;uid=Doctor Corpartion;pwd=MyPassword";
note: also I changed from 127.0.0.1 to LocalHost (it's the same)
EDIT: forgot to say: also try with username/password for your SQL Server, usually the username is sa