Hello,

I have an ActiveX-DLL (using VB-script) that creates some files.
When I use a direct path ("c:\wwwroot\...), the script works fine (see
below)
But if I use the Server.MapPath() there is an error: "Object required"

When I use the code in an ordinary .asp-file the Server.MapPath works fine.

' ----- Create the .fil-file
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile("c:\inetpub\wwwroot\catalog\" & temp &
"\" & fname & ".fil", True)
' Set f = fs.CreateTextFile(Server.MapPath(temp & "\" & fname &
".fil", True))

Anyone know what I can do?

Regards,

/Mikael S

Re: Server.MapPath by Joe

Joe
Mon Aug 25 05:24:56 CDT 2003

"Mikael" <mikael@slk.nu> wrote in message
news:O9qkrxuaDHA.2256@TK2MSFTNGP10.phx.gbl...
> Hello,
>
> I have an ActiveX-DLL (using VB-script) that creates some files.
> When I use a direct path ("c:\wwwroot\...), the script works fine (see
> below)
> But if I use the Server.MapPath() there is an error: "Object required"
>
> When I use the code in an ordinary .asp-file the Server.MapPath works
fine.
>
> ' ----- Create the .fil-file
> Set fs = CreateObject("Scripting.FileSystemObject")
> Set f = fs.CreateTextFile("c:\inetpub\wwwroot\catalog\" & temp
&
> "\" & fname & ".fil", True)
> ' Set f = fs.CreateTextFile(Server.MapPath(temp & "\" & fname &
> ".fil", True))
>
> Anyone know what I can do?
>
> Regards,
>
> /Mikael S
>
Are you trying to use Server.Mappath within the dll or on the page?
--

Joe




Re: Server.MapPath by Mikael

Mikael
Mon Aug 25 05:49:55 CDT 2003

I wan't the Server.MapPath to start at the .asp-file-location.
The files created in the .dll should be saved in a map under the .asp-file.

Regards,

/Mikael S



"Joe Fawcett" <joefawcett@hotmail.com> skrev i meddelandet
news:##70lMvaDHA.2548@TK2MSFTNGP09.phx.gbl...
> "Mikael" <mikael@slk.nu> wrote in message
> news:O9qkrxuaDHA.2256@TK2MSFTNGP10.phx.gbl...
> > Hello,
> >
> > I have an ActiveX-DLL (using VB-script) that creates some files.
> > When I use a direct path ("c:\wwwroot\...), the script works fine (see
> > below)
> > But if I use the Server.MapPath() there is an error: "Object required"
> >
> > When I use the code in an ordinary .asp-file the Server.MapPath works
> fine.
> >
> > ' ----- Create the .fil-file
> > Set fs = CreateObject("Scripting.FileSystemObject")
> > Set f = fs.CreateTextFile("c:\inetpub\wwwroot\catalog\" &
temp
> &
> > "\" & fname & ".fil", True)
> > ' Set f = fs.CreateTextFile(Server.MapPath(temp & "\" & fname
&
> > ".fil", True))
> >
> > Anyone know what I can do?
> >
> > Regards,
> >
> > /Mikael S
> >
> Are you trying to use Server.Mappath within the dll or on the page?
> --
>
> Joe
>
>
>