Manny
|
Posted: 03/23/2004, 7:03 PM |
|
I need to create a temporary mapped drive when a user selects a hyperlink.
The hyperlink points to a server location ie \\servername\sharename, this
info is contained in a field called trace_location.
Can someone help me with this.
Thanks
Manny
|
|
|
mramirez18
Posts: 56
|
Posted: 03/24/2004, 6:55 PM |
|
I found this code, how can i apply this with my field trace_location.
set ws1 = Server.CreateObject("WScript.Network")
ws1.MapNetworkDrive "T:","\\ip",false,"username","pw"
|
|
|
mramirez18
Posts: 56
|
Posted: 03/24/2004, 7:25 PM |
|
Currently, I am opening a shared drived via this method. But would like to use fso to map drive when link is clicked.
fldtrace_location=dlookup("apropos_server","trace_location", "apropos_server_id=" & fldtrace_location)
fldfield1 = "<a href="""& fldtrace_location &""" target=_blank>Trace Logs</a>"
Trace-location contains shared drive entries ie. \\servername\sharename
|
|
|
Nicole
Posts: 586
|
Posted: 03/25/2004, 3:20 AM |
|
Manuel,
You can create a link that opens blank page e.g. map.asp that maps the net drive using WScript.Network object. Pass trace_location value that stores net path to map.asp via create link URL parameters.
So use Label control to create link on CC page:
fldtrace_location=dlookup("apropos_server","trace_location", "apropos_server_id=" & fldtrace_location)
fldfield1 = "<a href=""map.asp?path="& fldtrace_location &""" target=_blank>Trace Logs</a>"
in map.asp retrieve "path" parameter and use it in a code:
Dim ip
ip = Request.QueryString("path")
set ws1 = Server.CreateObject("WScript.Network")
ws1.MapNetworkDrive "T:", ip ,false,"username","pw"
Hope it helps.
_________________
Regards,
Nicole |
|
|
mramirez18
Posts: 56
|
Posted: 03/28/2004, 4:32 PM |
|
I am using Codecharge 2.0.7, is this code going to work OK. I am not using ASP.NET.
|
|
|
mramirez18
Posts: 56
|
Posted: 03/28/2004, 5:44 PM |
|
Nicole,
When I run the I get the following error:
WSHNetwork.MapNetworkDrive (0x80070055)
The local device name is already in use.
/pilports/map.asp, line 109.
Line 109.
'Form1 Open Event begin
Dim ip
ip = Request.QueryString("path")
set ws1/ Server.CreateObject("WScript.Network")
ws1.MapNetworkDrive "T:", ip, false, "username","pwd"
1.What form type is best to use i.e Menu.
|
|
|
|