Results 1 to 4 of 4

Thread: Reading a Sequential File to a Database

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    1

    Lightbulb

    I have a current project in which I want to read information from a comma delimited text file into an Access Database through VB6. I am clueless as how to do this or if it is even possible. Is there some way to use the ADO control to do this?

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    If you read the file line by line, then use Split to get the values for each field. Then get a recordset for the table, and insert the values as required.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    New Member
    Join Date
    Nov 2000
    Posts
    10

    Cool

    If the delimited text file needs to be accessed alot and you will continue to use the program to do it, create a data-aware class. It is a bit of work, but once you set it up, you then access the text file as if it is a database and can use the ADO methods on it.

    In VB help, search for the following article:

    Creating a Data-Aware Class that Reads Records from a Delimited Text File


    It leads you step by step. You may not understand all of the steps at first, but include them if they are in the sample code. I have done this and it works fantastic.


    TTFN,

    Smashing Piggy

    "Beware of Big Bad Wolf dressed in Tigger clothes"

  4. #4
    Junior Member
    Join Date
    Nov 2000
    Posts
    27

    Thumbs up

    hi
    i was also looking out for the same kind of thing and while searching for it i got some answers for that
    so i m providing u the link where it is kept. If u still have problems then search for "text to database". U will surely get the answer

    any way i think these links will be very much helpful to U as they were to me.

    http://forums.vb-world.net/showthrea...threadid=40824

    http://forums.vb-world.net/showthrea...threadid=40849

    the first link has good sample code also.

    hope it helps and works
    cheers

    Vishal

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