Solved

Reading a textfile in another system

Posted on 2002-06-27
7
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 43

Expert Comment

by:TimCottee
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 "\\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
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("\\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
ID: 7114442
I am with Tim.
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 43

Expert Comment

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

Expert Comment

by:Richie_Simonetti
ID: 7159344
I hate this sort of things.
0
 

Expert Comment

by:ComTech
ID: 7160417
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
ID: 7160450
Thanks.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

617 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