Click to See Complete Forum and Search --> : ADO/Access/VB question
Ninel
Mar 28th, 2000, 10:04 PM
Hi, I am creating a VB application that uses ADO to connect to Access. I need to export a table that is located in Access to a text file using VB.Does anyone know how to do this? Please help.
Thanks,Ninel
Nias
Mar 28th, 2000, 10:46 PM
Try something like this (assuming your recordset is already open):
dim strDir as string
strDir = "filetowrite.txt"
Open strDir For Output As #1
If datFiles.Recordset.EOF Then
Else
With datFiles.Recordset
.MoveFirst
Do Until .EOF
fldname1 = !dbfldname1
fldname2 = !dbfldname2
fldname3 = !dbfldname3
fldname4 = !dbfldname4
fldname5 = !dbfldname5
Print #1, fldname1 & " " & fldname2 & " " & fldname3 & " " & fldname4 & " " fldname5
.MoveNext
Loop
.MoveFirst
End With
End If
Close #1
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.