help parseing data

From another EE expert:
Private Sub Command0_Click()

Dim intFilenum As Integer           'watch shows value 1--type interger--always 1
Dim intField As Integer             'watch shows as expected
Dim varArray(0 To 1434) As Variant  'watch shows as expected
intFilenum = FreeFile               'watch shows value 2 --type integer-- always 2
Open "c:\rTemp\aqu0207k\aqu0207.drf" For Input As #intFilenum

Do Until EOF(intFilenum)
  For intField = 0 To 1434
    Input #intFilenum, varArray(intField)

  'This is where you open your tables or invoke your queries to insert your data

Close #intFilenum

End Sub
Doing it this way means that the text fields will be stripped of their quote delimiters
automatically by the Input statement.  I used a zero-origin array for two reasons...
1. it is what the SPLIT() function would produce
2. a recordset's fields collection is zero-based

I follow some of the code.
What does freefile mean? Why this assignment intFilenum = FreeFile ?
Where are the rows? There should be 70 rows.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FreeFile is a VBA function that returns a pointer to a file from the OS.

intFilenum is needed later on in the code to point back to file handle in the OS so you can do things like read the text from the file into a variable.

The rows are read in one at a time in ... Input #intFilenum, varArray(intField)

Do Until EOF(intFilenum)

tells the code to loop through all lines (rows) in the file until there are no more so it will work for 70 as well as any other number of rows.

>What does freefile mean? Why this assignment intFilenum = FreeFile ?
When opening a file a number (Like #1, #2, etc) is required.
Th eFreeFile will return such a number that's not currently used as re-using a number in use gives an error.

The: Do Until EOF(intFilenum) will loop through all rows, the "For intField = 0 To 1434" will get the individual 1435 fields from the array.

Need more info ?

1)What does freefile mean? Why this assignment intFilenum = FreeFile ?

FreeFile is a built in VB function that returns a pointer to the Next Free FileHandle - an internal value that serves as the pointer to the file that you are working with.  This value is an Integer, and is then used, along with the # to identify the file, in the statements:

Open "c:\rTemp\aqu0207k\aqu0207.drf" For Input As #intFilenum  ' associates the fiilehandle #intFileNum (or in you case #2 with the physical file ("c:\rTemp\aqu0207k\aqu0207.drf") and opens the handle for Input (so you can read from the file)

Do Until EOF(intFilenum)  ' continues reading from the file until an End-of-file (EOF) is reached
  For intField = 0 To 1434
    Input #intFilenum, varArray(intField)  'Inputs from the file identified by #2,
  '  you will come to these lines ONCE for each record, so you should the save the varArray or it will be over-writen by the next record

I assume that you have 1435 separate fields in each of your 70 rows?

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

I'm running Access 2000 and it allows a maximum of 255 fields in a table.  If indeed you have 1435 fields per record, you are going to have to generate 6 tables to hold the data.
afreer2Author Commented:
I will need some time to understand what you all are showing me.

Yes but I will ask another question.

This is a csv file that "" puts out;they put 7-8 tables in one row(which is a horses history along with "todays race"
There will be as many rows as there are horses.

 'This is where you open your tables or invoke your queries to insert your data
This was going to be my next question.

You all answererd the question.
How do you eaperts want the pts devided?
FYI        I'm on 56k speed and I don't stay on line too long(If that makes any difference,slow responces):)

Points should be awarded on a split on the basis of how well the answer helped solve your problem.  If the answers has similar or equal value, award accordingly.  If the lions share was in one answer, and one or two others added a bit, again, award accordingly.  This is one area where you have to do the math ;))

There's a >Split points link at the bottom of this question allowing you to split the points.

as pointed out, you will need to add code, after the 1435 fields have been read for a record, to assign the values to the repsective tables, as any one table cannot have more than 255 fields.  This is where you biggest problem will be.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.