0

i am making a report of server utilisation./now there are many servers and for each server there is a txt file in a certain dir loc of that server. user will call the server by the name and the text file will be called from its respective location how to do ..plzz help

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by vb5prgrmr
0

You would need a service running on each server and you would have to call the service to feed you the text file. Or you can use the UNC path for each server to where the file is but you will have to have permissions to access the folder and file.


Good Luck

0

UNC Path

\\servername\sharename\filename

Private Sub MySub(FileToRead As String)

On Error GoTo MySubError

Dim FName As String, FNumb As Integer

'first check to see if local file exists and if so kill it
If Dir(App.Path & "\temp.txt") <> "" then Kill App.Path & "\temp.txt"

'save network resources and other problems that may arise from opening a file across the network by copying the file locally
CopyFile FileToRead, App.Path & "\temp.txt"

FName = App.Path & "\temp.txt"
FNumb = FreeFile

Open FName For Input As #FNumb
Do While Not EOF(#FNumb)
  '....
Loop

Close #FNumb

Kill FName

Exit Sub
MySubError:

'error handler here

End Sub

Or something like that...


Good Luck

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.