0
votes

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.

3

3 Answers

0
votes

Have you run the query on the new server as straight SQL and got the correct results back?

Have you performed a simple query using that connection string?

Can you do a hello world asp classic example on the server?

0
votes

Have you checked to see if Classic Asp is enabled. It is not by default in 2008.

0
votes

Try:

function get_name(emp_nbr) 
Dim CommonName,LastName,FullName 
    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
    CommonName = rs3("COMMON_NAME")
    LastName = rs3("last_name")
    rs3.close
    FullName = CommonName & " " & LastName
    get_name = FullName
end function