Are you sure it's returning a negative integer? You also need to specify the type of return value in your FUNCTION statement. It should be like this:
FUNCTION GetStudentCount(
cCountType as String, ;
cDataPath as String, ;
iSession as Integer, ;
cCode as String, ;
cMcode as string, ;
cLevelType as String, ;
cLevelVar as String, ;
lDistinct as Boolean) AS String
Note the final AS String (I typically return strings from my Web Services, however you *can* return an Integer if you prefer).
At first I was thinking the reason you may be having a problem is that you don't have this final return type specified, and it's not actually returning what you think it is. But, I'm probably barking up the wrong tree with that idea. The only other thing I can think of though, is that your path is not completely specified ... is it a full path or just a relative path?
~~Bonnie
>Here is the parameter statement.
>
>Method GetStudentCount()
>lparameters cCountType as String, cDataPath as String, iSession as Integer, cCode as String, cMcode as string, cLevelType as String, cLevelVar as String, lDistinct as Boolean
>
>When calling the DLL:
>object.GetStudentCount("1", "\\pot_bdc\columbus$\data"....
>
>In the DLL I handle for any data exceptions, with a negative integer returned if there is a problem opening 1 of the tables. My WS generates fine but when I run it the corresponding value is returned, telling me there is an issue with 1 of the tables.
>
>Many thanks Bonnie,
>
>Regards
>Paul