Reading a textfile in another system

Posted on 2002-06-27
Last Modified: 2010-05-02
I am working in a VB project.I am using two systems - A & B - in the same network.I want to open a textfile in system B from an appliction running in system A.In system A I have only the IP address of system, using this IP I want to read the textfile in a folder in system B.
Any solution??????

Question by:shaji_am
LVL 43

Expert Comment

ID: 7113979
If you have permissions to the folder that contains the textfile in system B you can use UNC naming to retrieve it

Open "\\\sharename\textfile.txt" For Input As #1

Here you can either use the computer name if known or the IP address instead. You need to be able to access the file/folder and have the necessary permissions to read this file but other than that it is straightforward.

Expert Comment

ID: 7114026
You could use the FileSystemObject to read the file.

Dim objFileSys As Object
Dim objFile As Object

Set objFileSys = CreateObject("Scripting.FileSystemObject")
Set objFile = objFileSys.openTextFile("\\\MyTest\test.txt", 1)
s = objFile.readall
Debug.Print s
Set objFileSys = Nothing
Set objFile = Nothing
LVL 16

Accepted Solution

Richie_Simonetti earned 50 total points
ID: 7114442
I am with Tim.
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

LVL 43

Expert Comment

ID: 7158953
I somehow think you chose the wrong comment!
LVL 16

Expert Comment

ID: 7159344
I hate this sort of things.

Expert Comment

ID: 7160417
It alright, Tim and I have solved this matter, just wanted the rest of you know.  Stuff happeans.

Thanks all,
CS Admin @ EE
LVL 16

Expert Comment

ID: 7160450

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 75
Visual Studio 2005 text editor 10 38
Set email body to html using vbscript 6 41
MS Access 03, TransferText, decimal places 8 69
Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question