SQL Server does not exist or access denied- ADO Connection
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SQL Server does not exist or access denied- ADO Connection
I am not abel to connect to database and execute query. Test complete throws an err that "
function SQLdbconnection() { var AConnection, RecSet; // Create a Connection object AConnection = ADO["CreateADOConnection"]() // Specify the connection string AConnection["ConnectionString"] = "Provider=SQLOLEDB;Data Source=192.168.0.98\QASQL;User ID=sa;Password=somepasword;Initial Catalog=mydbqa;Persist Security Info=False"; // Suppress the login dialog box AConnection["LoginPrompt"] = 0; AConnection["Open"](); // Execute a query RecSet = AConnection["Execute_"]("Select * from tax"); RecSet["MoveFirst"](); while (!RecSet["EOF"]) { Log["Message"](RecSet["Fields"]("tax1_name")["Value"], RecSet["Fields"]("tax2_name")["Value"]); RecSet["MoveNext"](); }; AConnection["Close"](); }
On executing above code I receive an error that "JScript runtime error. [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied"
What wrong I am doing ?
Otherinformation:
- My Testcomplete information: Version: 12.60.5545.7 x64.
- Microsoft Windows 10 Enterprise, 64-bit (10.0 Build 17763)
- Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (Intel X86)
Oct 19 2012 13:43:21
Enterprise Edition on Windows NT 6.2 <X64> (Build 9200: ) (WOW64)
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
While you are using C#Script, under the covers it is just JScript with some additional syntax rules applied. Because of that, if you're going to use the \ character in a string, you should double it up so that it actually is interpreted as a \.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
