Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

reading text file

Posted on 2003-02-28
6
Medium Priority
?
152 Views
Last Modified: 2010-04-07
Hi,
I have text file in windows2000 server.Can I read this file from a windows2000 professional by passing the user id and password in an open statement.
In my VB application I am using Filesystem object.
Cheers
0
Comment
Question by:shaji_am
5 Comments
 
LVL 18

Accepted Solution

by:
Sethi earned 200 total points
ID: 8041157
Set References to Microsoft Scripting Runtime in your VB project.

Declare the following variables in Declaration section:
     Dim objFSO As FileSystemObject
Dim objTextFile As TextStream
Dim strRead as String
     
Create the following Sub to Write to a textfile:
Public Sub WriteToFile()
     strFileName="C:\My Documents\Testing.txt"
         Set objTextFile = objFSO.OpenTextFile(strFileName, ForReading)
strRead = objTextFile.ReadAll
End Sub
'--- strFileName is the file name where you want to write the text along with the full path of the file.
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 8050019
shaji_am,

You have been asked to maintain your open questions previously and have failed to do so.
You have 8 opened questions as of this date.  
I will be posting in each of these questions older than a month.  
Please take care of your opened questions older than 30 days by clicking on your logon name link and looking for UnlockedQ or using the links I am providing below.  
Please finalize these within 72 hours or I will ask administration to look into your account at that point.  
If you have questions, please ask and I will provide assistance.  

http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20340207.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20247782.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20117484.html
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_20117472.html
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_20105806.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20375340.html
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_20324261.html

Thank you.
0
 

Expert Comment

by:CleanupPing
ID: 8900985
shaji_am:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 8903998
recommendation: answered by Sethi
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9001639
Moderator, my recommended disposition is:

    Accept Sethi's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

572 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