Compare two DBTables objects
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2010
07:31 AM
02-10-2010
07:31 AM
Compare two DBTables objects
Hi,
I need to compare data from two different database servers. Both are SQL Server, but different connection strings. So I create two Stores | DBTables, say DBTables1 and DBTables2, then compare if records in DBTables1 are same as DBTables2. It works in most cases, sometimes it doesn't. If my SQL query doesn’t return any record, which is one of normal cases, then the DBTables cannot be created. Is this configured in the Project Properties? Or should I use other way to do this test?
Thanks a lot!
Nancy
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2010
10:27 PM
02-11-2010
10:27 PM
Hi Nancy,
Currently, the DBTable Checkpoint feature of TestComplete does not allow saving baseline data without any records. I have registered your request as a suggestion in our database.
In the meantime, you can use the ADO extension to check whether there are any records recorded by a request.
function testADORequest()
{
var Cmd = ADO.CreateADOCommand();
Cmd.ConnectionString = "Driver={SQL Server Native Client 10.0};Server=myServer;Database=myDatabase; Uid=myUsername;Pwd=myPassword;";
Cmd.CommandText = "SELECT * FROM USERS WHERE PEN_NAME = 'Nancy'";
Cmd.CommandType = cmdText;
var RecSet = Cmd.Execute();
if (RecSet.EOF == true) {
Log.Message("The recordset is empty");
}
else {
Log.Message("The recordset contains items");
}
}
--
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Dmitry Nikolaev
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
