I am writing a navigation system in classic ASP (on Windows CE). I need a way to dynamically include navigation files based on the calling script. I came up with the following code, which includes nav.inc, which is in the folder of the calling script, to allow different folders to have different navigation functions.
This works fine on my Windows test machine, but NOT when deploying to Windows CE. Code and error are shown below. If someone can provide work or any feedback, that would be great. Thanks
the code:
<%
'Get path name
Dim i
fullname = Request.ServerVariables("SCRIPT_NAME")
my_array=split(fullname,"/")
fname=my_array(ubound(my_array))
fname = ""
For i = 0 to ubound(my_array) - 1
fname = fname & my_array(i) & "/"
Next
fname = fname & "nav.inc"
Set fs=Server.CreateObject("Scripting.FileSystemObject")
If (fs.FileExists(Server.MapPath(fname)))=true Then
Server.Execute(fname)
End If
%>
Error:
Microsoft VBScript runtime error: '800a01b6'
Description: The object does not support this property or method: 'Server.CreateObject'
If I change the code, I just say Set fs=CreateObject("Scripting.FileSystemObject"), I get the following error:
Microsoft VBScript: '800a01ad'
: ActiveX : 'Scripting.FileSystemObject'
Server.Execute , . , Server. ?