HighTechTalks DotNet Forums  

Unable to access folders across two servers.

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Unable to access folders across two servers. in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Neeba
 
Posts: n/a

Default Unable to access folders across two servers. - 12-17-2007 , 01:14 AM






Scenario :

1. The Department files to be accessed are present in the File server.
2. The Code is present in a different server with OS being Windows Server
2003.
3. Access to File server happens using ADS Authentication.
4. Code is developed in ASP.NET using VB.NET. (Web.Config file settings are
based on ADS Login; Authentication=Windows ; )
5. Requirement is to display folders and files in a treeview structure.
[Built in functions like GetDirectories and GetFiles returns nothing and
functions related to Kernel Programming like (Private Declare Function
FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As
String, ByRef lpFindFileData As WIN32_FIND_DATA) As Integer—ïƒ* Returns -1 )]
when executed from Windows Server 2003.
6. The same code works fine without any issues when run locally from an XP
machine.

Problem 2 : Unable to generate Excel Application in ASP.NET using Interop
Assemblies.

Scenario

1. The Code is present in a server with OS being Windows Server 2003.
2. Microsoft Office 2003 along with SP3 and interop assemblies dll is
installed on the server.
3. The Code snippet mentioned below does not show up any error but at the
same time will not generate an excel sheet.

Dim excel As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet

excel = New Microsoft.Office.Interop.Excel.Application

excel.Visible = True
wb = excel.Workbooks.Add(XlWBATemplate.xlWBATWorksheet)
ws = CType(wb.Worksheets(1), Worksheet)
ws.Name = "sample"

4. The same code works fine when run on a local XP machine.


Reply With Quote
  #2  
Old   
Phill W.
 
Posts: n/a

Default Re: Unable to access folders across two servers. - 12-17-2007 , 07:54 AM






Neeba wrote:

Quote:
Scenario :
.. . .
4. Code is developed in ASP.NET using VB.NET. (Web.Config file settings are
based on ADS Login; Authentication=Windows ; )
.. . .
6. The same code works fine without any issues when run locally from an XP
machine.
Your code is almost certainly suffering from either
A permissions problem - web applications run with a /lower/ set of
permissions than an interactive user, or
A "network visibility" problem - web servers generally aren't allowed to
"see" the network (and certainly not mapped drives).

Quick test: Reconfigure the web application to run under a specified
account (under which the code /works/) and see if things improve.

Quote:
Scenario
.. . .
1. The Code is present in a server with OS being Windows Server 2003.
2. Microsoft Office 2003 along with SP3 and interop assemblies dll is
installed on the server.
3. The Code snippet mentioned below does not show up any error but at the
same time will not generate an excel sheet.
And how would you know even if it did?

The Web server is a Windows Service and, as such, runs on a (I can't
call it "virtual" any more, so) "pretend" desktop that /nobody/ ever can
get to look at (which is why ASP[.Net] doesn't have a MsgBox function).
Unless you /save/ the modified WorkBook, how are you going to see if
a new Worksheet has been added?

HTH,
Phill W.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.