Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNC File path problem ?

Status
Not open for further replies.

Recce

Programmer
Aug 28, 2002
425
ZA
Good day,

I have problem accessing a file over the network in JavaScript.Can anyone please help me by having a look at where my problem could be.Below is the code.Thanks very much :)


<script language="JavaScript">


var fso, f, s="";

fso = new ActiveXObject("Scripting.FileSystemObject");

// This is my UNC file path
f = fso.GetFile("\\\\myserver\\c$\\Cube.txt");

s += "Last Updated: " + f.DateLastModified;



// Define the required references to the pivot table
var objPivot = document.all."AWD Outstanding Queues";

// connect to the sales cube
objPivot.ConnectionString = "Provider=msolap;Data Source=KMSRV.momentum.co.za;Initial Catalog=Knowledge";
objPivot.DataMember = "AWD_Outstanding_Queues";

// define column definitions
var objView = objPivot.ActiveView;
var objFlds = objPivot.ActiveView.FieldSets;
objView.ColumnAxis.InsertFieldSet(objFlds("[Outstanding Bands]"));
objView.RowAxis.InsertFieldSet(objFlds("[Region]"));
// objView.RowAxis.InsertFieldSet(objFlds("[Movement]"));
objView.DataAxis.InsertTotal(objView.Totals("Count"));


// specify the format of the output and caption

var str1 = "AWD Outstanding Queues - ";
var str2 = s;
var s = str1.concat(str2);

objView.TitleBar.Caption = s
// objView.Totals("Commission").NumberFormat = "#,#;- #,#"
// objView.Totals("Production").NumberFormat = "#,#;- #,#"
// objView.Totals("Advisor Api").NumberFormat = "#,#;- #,#"
// objView.Totals("Production credits").NumberFormat = "#,#;- #,#"
// objView.Totals("Target").NumberFormat = "#,#;- #,#"
// objView.Totals("% Over/Under Target").NumberFormat = "#,#;- #,#"
objView.Totals("Count").NumberFormat = "#,#;- #,#"

// display the required control options
objPivot.DisplayFieldList = 1;
objPivot.AllowFiltering = 1;
objPivot.DisplayExpandIndicator = 1;
objPivot.DisplayToolbar = 1;
</script>


</html>
 
I'm not sure FSO supports UNC paths... only DOS-mapped drive letters.
 
Hello all,

Just for clarification, fso supports unc.

regards - tsuji
 
True... just checked docs.
Then problem is probably about permissions (c$ is administrative share).
 
Hi there,

The problem seem to be solved at the moment. I have not changed anything so, I am not sure what was wrong. Thanks for all the replies. The \\\\myserver\\c$\\Cube.txt seem to be working. Thanks :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top