I have an asp script that is working fine until I use a function
Code:
dim dispCountry
dispCountry = '1'
dispCountry= GetCountry( Cint(dispCountry) )
Code:
Function GetCountry( CountryNo )
Dim rsCountry, CountryName, SQLcmd
GetCountry = "UNSPECIFIED"
strSQL = "dbo.OS_GetCountry(" & CountryNo & ")"
Set SQLcmd = Server.CreateObject("ADODB.Command")
With SQLcmd
.ActiveConnection = adoCon
.CommandType = adCmdStoredProc
.CommandText = strSQL
End With
Set rsCountry = SQLcmd.Execute()
rsCountry.MoveFirst
While rsCountry.EOF=False
CountryName = rsCountry("NAME")
Wend
GetCountry = CStr(CountryName)
End Function
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?
J.
:(