Connect To sqlServer Database Problem
-
wrote on 4 Aug 2016, 05:02 last edited by
@SGaist
what you error caught during execution? -
@SGaist
what you error caught during execution?wrote on 4 Aug 2016, 05:12 last edited by@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.
-
Rather than fail you should print the content of QSqlDatabase::lastError.
wrote on 4 Aug 2016, 19:31 last edited by M4RZB4Ni 8 Apr 2016, 19:32@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.
-
wrote on 4 Aug 2016, 19:57 last edited by
Hi, also to add to @SGaist, don't use Named Pipes for the connection (they're kind of ancient) instead you could try something simple like:
QString dsn="DRIVER=SQL Server;Server=127.0.0.1; Database=Test;Trusted_Connection=Yes";
-
Hi, also to add to @SGaist, don't use Named Pipes for the connection (they're kind of ancient) instead you could try something simple like:
QString dsn="DRIVER=SQL Server;Server=127.0.0.1; Database=Test;Trusted_Connection=Yes";
wrote on 4 Aug 2016, 20:55 last edited by@hskoglund
Thanks
i Replaced that ip But Showed Me This Message
ERROR
Sql Server -
wrote on 4 Aug 2016, 21:05 last edited by hskoglund 8 Apr 2016, 21:08
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
-
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
wrote on 5 Aug 2016, 07:24 last edited by@hskoglund
Thank You So much man
My Problem Solved!
12/12