If I run the following code I get:
Wrong number of arguments or invalid property assignment: 'FunctDBSelect'
The code will work if:
session("sessionDB") is blank
The .asp page is:
<!--#include file="VBFunctions.inc" -->
<%
if session("sessionDB") <> "" then
test = FunctDBSelect(session("sessionDB"))
varDSN = FunctDBSelect(FunctDBSelect)
else
varDSN = "sns_prod"
end if
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open varDSN
%>
the VBFunctions.inc file has the code of:
<%Function FunctDBSelect(useDB)
select case useDB
case "ADSFO"
FunctDBSelect = "ADSFO_prod"
case "AFSS"
FunctDBSelect = "AFSS_prod"
case "CHS"
FunctDBSelect = "CHS_prod"
case "Demo"
FunctDBSelect = "Demo_prod"
case "EP"
FunctDBSelect = "EP_prod"
case "NSS"
FunctDBSelect = "NSS_prod"
case "OE"
FunctDBSelect = "OE_prod"
case "PMP"
FunctDBSelect = "PMP_prod"
case "RN"
FunctDBSelect = "RN_prod"
case "SP"
FunctDBSelect = "SP_prod"
case "SS"
FunctDBSelect = "SS_prod"
case "WI"
FunctDBSelect = "WI_prod"
case "WSO"
FunctDBSelect = "WSO_prod"
return FunctDBSelect()
end select
End Function%>
Wrong number of arguments or invalid property assignment: 'FunctDBSelect'
The code will work if:
session("sessionDB") is blank
The .asp page is:
<!--#include file="VBFunctions.inc" -->
<%
if session("sessionDB") <> "" then
test = FunctDBSelect(session("sessionDB"))
varDSN = FunctDBSelect(FunctDBSelect)
else
varDSN = "sns_prod"
end if
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open varDSN
%>
the VBFunctions.inc file has the code of:
<%Function FunctDBSelect(useDB)
select case useDB
case "ADSFO"
FunctDBSelect = "ADSFO_prod"
case "AFSS"
FunctDBSelect = "AFSS_prod"
case "CHS"
FunctDBSelect = "CHS_prod"
case "Demo"
FunctDBSelect = "Demo_prod"
case "EP"
FunctDBSelect = "EP_prod"
case "NSS"
FunctDBSelect = "NSS_prod"
case "OE"
FunctDBSelect = "OE_prod"
case "PMP"
FunctDBSelect = "PMP_prod"
case "RN"
FunctDBSelect = "RN_prod"
case "SP"
FunctDBSelect = "SP_prod"
case "SS"
FunctDBSelect = "SS_prod"
case "WI"
FunctDBSelect = "WI_prod"
case "WSO"
FunctDBSelect = "WSO_prod"
return FunctDBSelect()
end select
End Function%>