Results 1 to 2 of 2

Thread: ADO/Access/VB question

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    1
    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

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Omaha, Ne
    Posts
    65

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width