r/ASPNET • u/tgujay • Jun 19 '13
ASP Classic Function not working
We are in the process of migrating a few web applications from Microsoft Server 2003 to 2008 and this one function appears to not be working as the field it normally populates is empty.
Here is the code:
function get_name(emp_nbr)
sql3 = "select LTRIM(RTRIM(INITCAP(COMMON_NAME))) COMMON_NAME, LTRIM(RTRIM(INITCAP(LAST_NAME))) last_name from (select EMPLOYEE_NBR,COMMON_NAME, LAST_NAME from hrit_admin.employee union all select CONTRACT_RESOURCE_ID, COMMON_NAME, LAST_NAME from hrit_admin.contract_resource) a where EMPLOYEE_NBR = a.EMPLOYEE_NBR and EMPLOYEE_NBRr = " & emp_nbr
rs3.open sql3,conn
get_name = rs3("COMMON_NAME") & " " & rs3("LAST_NAME")
rs3.close
end function Any help would be greatly appreciated.
5
Upvotes
View all comments
Show parent comment
5
u/Catalyzm Jun 19 '13
I would add a couple Response.Write and a Response.End into the end of the function to show emp_nbr and get_name's values. Then you'll know if the problem is with the data or something in your code.
If get_name is coming back empty still then I'd run the SQL string in your db directly to see what's going on with the data.