||ADO Query Parameters
||Tue, 15 Sep 2020 16:40:41 -0400
I need to move a dbase application over to a new server - the servers were 2002 on the old one and 2016 on the new one.
I've tried to recompile the application and it appears to work up to the point that it gets the data. The request fails to populate a Grid as I am setting parameters in the Form_Open function
What I have is as follows:
this.ADODATABASE1 = new ADODATABASE(this)
left = 31.0
top = 17.0
connectionString = "Provider=MSDASQL.1;****" //taken out for security
active = true
this.ADOQUERY1 = new ADOQUERY(this)
left = 91.0
top = 21.0
database = form.adodatabase1
connected = true
l1 = "select * from com forms t WHERE c.tutref LIKE :TT AND processed LIKE :PP AND monthlist LIKE :MM AND (commyear LIKE :YY OR commyear LIKE :YY2)"
sql = l1
active = true
onNavigate = class::ROWSET_ONNAVIGATE
nthisyear = year(date())
nlastyear = year(date())-1
params["TT"].value = "%"
params["PP"].value = "F"
params["MM"].value = "%"
params["YY"].value = nthisyear
params["YY2"].value = nlastyear
This does not work.
If I then rip out the parameters and put in the values as this:
l1 = "select * from com forms t WHERE c.tutref LIKE '%' AND processed LIKE 'F' AND monthlist LIKE '%' AND (commyear LIKE 2020 OR commyear LIKE 2019)"
Then I get records back that I would expect. Any ideas what I am doing wrong please as I have looked at the language reference and don't see any issues with my code.