Click to See Complete Forum and Search --> : Reading a Sequential File to a Database
mcapps
Nov 14th, 2000, 12:07 PM
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?
parksie
Nov 14th, 2000, 02:24 PM
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.
SmashingPiggy
Nov 15th, 2000, 08:11 AM
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.
vishalmdattani
Nov 29th, 2000, 02:58 AM
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/showthread.php?threadid=40824
http://forums.vb-world.net/showthread.php?threadid=40849
the first link has good sample code also.
hope it helps and works
cheers
Vishal
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.