Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 25th, 2005, 08:14 AM
Registered User
Join Date: Mar 2005
Location: Pune, Maharashtra, India.
Posts: 9
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Anup Gavate Send a message via Yahoo to Anup Gavate
Default Method or Data member not found

Hi all,

I am in big trouble and i need help to sort out file read write problem.

Following code is not working and displaying error "Method or Data member not found". Please let me know if i need to include any reference file other than scrrun.dll to execute following code.

    Dim fsoObject As New Scripting.FileSystemObject
    Dim txtFileObject As Scripting.File

    If fsoObject.FileExists("c:\conn.ini") Then
        MsgBox "Exists!!!"

        Set txtFileObject = fsoObject.OpenTextFile("c:\conn.ini", ForReading)

        Do Until txtFileObject.AtEndOfStream
            txtFileObject.ReadLine ("[StartUp]")
        MsgBox "Not Exists!!!"

        Set txtFileObject = fsoObject.CreateTextFile("c:\conn.ini", ForWriting)

        txtFileObject.WriteLine ("[StartUp]")
        txtFileObject.WriteLine ("UID=sa")
        txtFileObject.WriteLine ("Password=manish")
        txtFileObject.WriteLine ("Server=Anup")
        txtFileObject.WriteLine ("DBName=thanksdarling")

        MsgBox "File created and data written to the file!!!"
    End If

    Set txtFileObject = Nothing
    Set fsoObject = Nothing

Reply With Quote
  #2 (permalink)  
Old March 25th, 2005, 03:49 PM
Friend of Wrox
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts

in the line

 Dim txtFileObject As Scripting.File

mybe you meant

 Dim txtFileObject As Scripting.TextStream

The line

  txtFileObject.ReadLine ("[StartUp]")

is wrong, because txtFileObject foes not parameters, it just returns a string

Just for curiosity, did you download that code?
Reply With Quote
  #3 (permalink)  
Old March 25th, 2005, 04:50 PM
Friend of Wrox
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts

Another suggestion: run with a full compile (Ctrl+F5), in this way the compiler will find the compiler errors before you run, and it will show the first of them in the IDE, highlighting the wrong line.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
complile error : method or data member not found! Tasha Access VBA 6 May 1st, 2007 03:49 PM
Method or Data Member not Found Related to Crystal ishqvj Beginning VB 6 0 November 29th, 2006 03:49 AM
Method or data member not found Subuana Beginning VB 6 1 March 6th, 2006 03:32 PM
LoadFrom Invoke Member... Method not found DolphinBay VB.NET 2002/2003 Basics 1 April 29th, 2004 10:01 AM
LoadFrom Invoke Member... Method not found DolphinBay ASP.NET 1.0 and 1.1 Basics 0 April 29th, 2004 09:29 AM

All times are GMT -4. The time now is 10:11 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.