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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting To External Text (.txt) File

Status
Not open for further replies.

bdavis96

Programmer
Feb 11, 2002
97
0
0
US
I am looking for some ideas on how best to go about doing this. Right now I am using MS Access to do a linked table to the text file with fixed width. The problem with linked tables, they seem to open up with exclusive rights, therefore, only one person can have it open at a time. Does VB6 have an object (like a recordset) that can connect directly to the text file, or maybe even a read-only object that will connect to the linked table? Any help would be much appreciated.
 
Microsoft has a text file driver for ODBC. You can use this to connect to the text file and load it into a recordset. I have done a little testing and it appears that you can have multiple connections to the data at the same time. However, since your file is fixed width I believe you will have to parse the data into the correct fields - the recordset will have just one big field with all the data for each record in it.

Hope this helps.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top