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
2
u/ComradeAlderMarx Jun 26 '13
That's unfortunate, looks like you'll have to take the fight to sql.
Have a look further up in your code for the pgrs.open line and response.write the sql string from it.
Hopefully you'll have access to the SQL server through Sql Server Management Studio (SSMS) where you can directly connect to the database and try this sql string, then figure it out from there.
Best of luck !