Solved

Reading a textfile in another system

Posted on 2002-06-27
7
154 Views
Last Modified: 2010-05-02
Hi,
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 B.ie, using this IP I want to read the textfile in a folder in system B.
Any solution??????

Regards
Shaji_am
0
Comment
Question by:shaji_am
7 Comments
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
If you have permissions to the folder that contains the textfile in system B you can use UNC naming to retrieve it

Open "\\127.0.0.1\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.
0
 
LVL 5

Expert Comment

by:rpai
Comment Utility
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("\\173.23.37.3\MyTest\test.txt", 1)
s = objFile.readall
Debug.Print s
Set objFileSys = Nothing
Set objFile = Nothing
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 50 total points
Comment Utility
I am with Tim.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
I somehow think you chose the wrong comment!
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
I hate this sort of things.
0
 

Expert Comment

by:ComTech
Comment Utility
It alright, Tim and I have solved this matter, just wanted the rest of you know.  Stuff happeans.

Thanks all,
ComTech
CS Admin @ EE
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
Thanks.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) 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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now