Unable to pass the variables in SQL query through test complete script
Can anyone please explain how to pass variables into SQL query through script:
Below is the syntax that we are using and getting an error:
Qry.SQL = "Select * from Aq1lookupalarapart where apar_id=CASID and dde_level_over= DDE_Updated_Value order by last_update desc"
**CASID, DDE_Updated_Value are the variables that we have captured from our application and we are trying to pass values captured through thses variables into SQL query and getting failed to get the result.
We also tried to add these varibale to project variable list and then pass them to the SQl query but it this attemp was also failed.
Below is the complete script:
Qry.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Agresso_QA;Data Source=GLNWD021\QA"
' Specify the SQL expression
Qry.SQL = "Select * from Aq1lookupalarapart where apar_id=CASID and dde_level_over= DDE_Updated_Value order by last_update desc"
' Execute the query
Qry.Open
' Process results and insert data into the test log
Qry.First
While Not Qry.EOF
Log.Message Qry.FieldByName("apar_id").Value
Qry.Next
Wend
Closes the query
Qry.Close