r/ASPNET • u/tgujay • Jul 09 '13
ASP Classic App problem with new server and provider
Full page code here
This is a web app that is currently hosted on a Windows Server 2003 server and we are migrating it to a Server 2008 server as part of a move away from all of our Server 2003 servers. The current server uses the MSDAORA provider but as that is not supported in Server 2008 we are now using the oraOLEDB.Oracle provider and everything is fine except for a name field related to the get_name function and a related query.
Main problem area that I can see is this function here:
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_nbr = " & emp_nbr
rs3.open sql3,conn
get_name = rs3("COMMON_NAME") & " " & rs3("LAST_NAME")
rs3.close
end function
When I output the query in the function as dynamic sql I get this:
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_nbr =
Which obviously is having a problem with emp_nbr, it doesn't have a value for it and as such is outputting nothing and breaking a field that uses get_name.
Any and all help would be greatly appreciated.
View all comments
Show parent comment
1
u/[deleted] Jul 09 '13
pgrs not an an empty recordset it looks like because it's not .EOF or it wouldn't get to line 352.
I just noticed that on line 352 it references it as "employee_nbr" but on line 363 it references it in all caps "EMPLOYEE_NBR". Perhaps your new drivers that you're using are case sensitive? Try both.
Just before the function call on line 352 do this:
Response.Write("CAPS:" + pgrs("EMPLOYEE_NBR") + "<br>")
Response.Write("LCASE:" + pgrs("employee_nbr"))
see if one of them returns a value and not the other