I have an asp script that is working fine until I use a function
dispCountry = '1'
dispCountry= GetCountry( Cint(dispCountry) )
Function GetCountry( CountryNo )
Dim rsCountry, CountryName, SQLcmd
GetCountry = "UNSPECIFIED"
strSQL = "dbo.OS_GetCountry(" & CountryNo & ")"
Set SQLcmd = Server.CreateObject("ADODB.Command")
.ActiveConnection = adoCon
.CommandType = adCmdStoredProc
.CommandText = strSQL
Set rsCountry = SQLcmd.Execute()
CountryName = rsCountry("NAME")
GetCountry = CStr(CountryName)
If I comment the line executing the function the whole script works, with it in, the script just hangs until "Navigation to the webpage was canceled" happens. The Number is definitely in the table.
Can anyone help me please? What is going wrong? How can I get the script to tell me what is going on?