Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Reading a textfile in another system

Posted on 2002-06-27
7
Medium Priority
?
172 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
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 150 total points
ID: 7114442
I am with Tim.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

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 …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 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…

886 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