Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to append data in text file in vb 6 by using dao

Status
Not open for further replies.

andypower

Programmer
Aug 10, 2004
23
0
0
IN
hello my self avi developing one industrial related software. here i m using DAO liabrary. i want to transfer some my data in text file. i dont know any thing about file handling in vb. so please some one help me
How To Open text file
How To Append Data
How To check out file all ready exit or not
plz hekp me
 
File System Object is your new friend now.....

and some examples

Dim fso as Object
Dim folder As Object
Dim files As Object
Dim file As Object
Dim myFile As Object


Set fso = CreateObject("Scripting.FileSystemObject")
If Not fso.FolderExists(Data_Folder) Then fso.CreateFolder (Data_Folder)

fso.CopyFile SourceFolder & OldFileName, Destination_Folder & NewFileName

Set folder = fso.GetFolder(Search_Folder)
Set files = folder.files
For Each file In files

Next
fso.deletefolder (Data_Folder), True

Set file = fso_OpenTextFile(App_Folder & "Collection_AutoUpdate.log", 8, 0)
my_Text = Date & " " & Time() & Chr(10) & my_Text
file.writeline (my_Text)
file.Close


Set f = fso.getfile(Data_Folder & FileName)
Set ts = f.OpenAsTextStream(1, -2)
S = ts.ReadLine
ts.Close
msgbox f.DateLastModified)


and many more if you search for FileSystemObject Object
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top