Forum Discussion
rohini11
New Contributor
Hi Satish,
Thanks for the reply.
I'm beginner in coding and trying to work with Java script.
Mr_Bro
4 years agoChampion Level 0
rohini11 ,
can you please try the below snippet by changing the necessary connecting string and query and tell us what is the error:
function TestProc()
{
var AConnection, RecSet;
AConnection = ADO.CreateADOConnection();
AConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;"+
"Data Source=C:\\Users\\Public\\Documents\\TestComplete 14 Samples\\Desktop\\Checkpoints\\XML\\DataGridViewSample\\OrdersDB.mdb";
AConnection.LoginPrompt = false;
AConnection.Open();
// Execute a simple query
RecSet = AConnection.Execute_("SELECT * FROM orders WHERE [quant] > 1");
RecSet.MoveFirst();
while(! RecSet.EOF)
{
//Print the recordset value into the Log
Log.Message(RecSet.Fields.Item("name").Value);
RecSet.MoveNext();
}
AConnection.Close();
}