The Code:
Then, I call the function using:
if getprojectinfo(request("projectnumber"),request("period"),request("year"),"pbrtype") = "Baseline" then
' Do this
end if
However, it doesn't recognize anything within the function.
If I add a response.write in the function, it will print out "Baseline".
How do I use what it finds?
Code:
function getprojectinfo(pn,pd,yr,var)
call opendb()
strsql = "select pid," & var & " from pbr where projectnumber = '" & pn & "' and period = '" & pd & "' and year = '" & yr & "';"
'response.write strsql
set objrs = objconn.execute(strsql)
if objrs.eof or objrs.bof then
strsql = "select top 1 pid," & var & " from pbr where projectnumber = '" & pn & "' order by pid desc;"
set objrs = objconn.execute(strsql)
if objrs.eof or objrs.bof then
myvar = ""
else
id = objrs(0)
myvar = objrs(1)
end if
else
id = objrs(0)
myvar = objrs(1)
end if
call closedb()
end function
Then, I call the function using:
if getprojectinfo(request("projectnumber"),request("period"),request("year"),"pbrtype") = "Baseline" then
' Do this
end if
However, it doesn't recognize anything within the function.
If I add a response.write in the function, it will print out "Baseline".
How do I use what it finds?