Thong_Ispector 2 Practically a Master Poster

When can you use FSO in a VB 5 program?
I got it working... I know it is supposed to be for ASP...
But why does it work in some applications ans situations and not others.?


Here is the code

Private fso As New FileSystemObject
Private strName As String

Private Sub Command1_Click()
With fso
strName = .BuildPath(Text2.Text, Text3.Text)
Set strm = .CreateTextFile(strName, True)
strm.Write (Text1.Text)
End With
MsgBox "text saved"
Exit Sub
a:
MsgBox "an error has occurd"
End Sub

Private Sub Command2_Click()
' Text1 is used to display the text file
' Text 2 is the Drive
' Text 3 is the Filename...

On Error GoTo a
With fso
strName = Text2.Text & "\" & Text3.Text
Set strm = .OpenTextFile(strName, ForReading)
With strm
Do Until .AtEndOfStream
Text1.Text = Text1.Text & .ReadLine & vbCrLf
Loop
End With
End With
Exit Sub
a:
MsgBox "an error has occurd"
End Sub