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

Reading data from .txt or .cvs file via VB 6.0

Status
Not open for further replies.

MavrickStl

Programmer
Feb 20, 2001
71
US
Guys,

I am trying to write a VB 6.0 program to read data from .txt or .cvs (Comma delaminated or Tab separated) files and save it into different variables. Later I want to write this data into an Oracle database.

Thanks, Mavrick
 
mavrickstl

the easist way to get the file, and the line from ..


dim nFileNo as integer
dim sList
dim sInLine as string
dim Lp as integer

open 'myfile.txt' for input as #nFileno
input #nfileno, sInline ' get the line into sInline
close #nfileno

slist = split(sinline,"'") ' create an array of items spliting each by a ,(comma)
' you could change this fo vbtab for the other file type

' to iterate through the items
for Lp = 1 to ubound(slist)
debug.print slist(lp)
next Lp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top