Input past end of File, what does that mean ?

RompStar

Well-known Member
Joined
Mar 25, 2005
Messages
1,200
So I use Access, someone who isn't here no more made a Metrics System using Access, and there is a FORM that I use to input a textfile.txt file into Access.

After doing it's thing, at the end, a window pops up saying:

"Input past end of file"

What does this mean ?

Thank you for your help.
 
I can't see a HEX number causing a problem, not with EOF anway.:)
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Ok, let me ask you this then :- )

I have a Excel file *.xls, I convert that into a CSV file and I prescan the Excel file for commas first and remove then, then I convert to CSV

Would there be any characters where Access could choke on EOF while parsing the file ? to find EOF, something that would potentially split out and Input past end of file error ?

Because I am thinking there might be something that changed with the text files that another company prepares for us, I don't want to point any fingers until I find the problem.

Or it could be a code think, only thinking this, because it's been used for 3 years without any problems, and all of a sudden the error came up last week.
 
Upvote 0
In order to import the SCV file into Access, that's the way it's been setup by the previous person.
 
Upvote 0
Why not just import directly from Excel to Access?
 
Upvote 0
That's the way it's been done, not sure...

Maybe the person who developed this thought CSV way the safest way to go about it.

So importing Excel straight into Access is the same as using CSV ?
 
Upvote 0
So importing Excel straight into Access is the same as using CSV ?
Not quite.:)

It's still a little unclear exactly what you want to do and what the purpose of the code is.

I would suggest that you sit down and try and work out in words what exactly is happening/supposed to be happening.

It's hard for us to interpret the code without seeing data and without more information on your setup.

In the meantime I suggest you look at File>Get External Data... to import/link the Excel file.
 
Upvote 0
Ok, I stepped into the Debugging mode and Stepped over line by line, it stopped on this line ----> and then went straight to the error handling part of this code.

----> rst.Open "RECDISVOL", cnn2, adOpenKeyset, adLockOptimistic, _
adCmdTableDirect

and RECDISVOL is a table, do you think there is a problem with the Table or this code ?

Sorry if I don't make sense, still new, Company is going to bring an Access expert, but wanted to look into it further to learn.

Sub PopulateTableRECDISVOL()
Dim removeHeader As String
Dim pkgid As String
Dim tracknum As String
Dim priority As String
Dim indate As String
Dim procdate As String
Dim deldate As String
Dim carrier As String

On Error GoTo Err_Duplicate
Do
filename = InputBox("Enter Receiving Filename (filename.ext)", "Receiving File")
If filename = "" Then
MsgBox "Enter Filename", vbOKOnly, "ERROR"
End If
Loop Until filename <> ""
CursorHourGlass
filename = path & filename


----> rst.Open "RECDISVOL", cnn2, adOpenKeyset, adLockOptimistic, _
adCmdTableDirect

Open filename For Input As #1
' Input #1, removeheader, removeHeader, removeHeader, removeHeader, removeHeader, removeHeader, removeHeader' REMOVE HEADER
Do While Not EOF(1)
Input #1, pkgid, tracknum, carrier, priority, indate, procdate, deldate 'WILL NEED TO ADD CARRIER VARIABLE
rst.AddNew
rst!pkgid = pkgid
rst!tracknum = tracknum
rst!priority = priority
rst!indate = indate
rst!procdate = procdate
rst!deldate = deldate
rst.Update
rst.CancelUpdate
Loop
If rst.EOF = True Then
'DO nothing
ElseIf rst.EditMode = adEditAdd Then
rst.CancelUpdate
End If
rst.Close
Close #1
Exit Sub

Err_Duplicate:
If Err.Number = errorNumDup Or Err.Number = errorNumRange Or Err.Number = errorType Then
Resume Next
End If
Err.Raise Err.Number
End Sub
 
Upvote 0
This is the example of the text file that is being inputed for processing...

5339586,5555555555,FedEX,Inter-Office,8/31/2006 11:24:00,9/1/2006 7:57:00,9/1/2006 15:09:00
5339588,55555555555,FedEX,Inter-Office,8/31/2006 11:24:00,9/1/2006 7:57:00,9/8/2006 9:10:00
5339592,5555555555,FedEX,Inter-Office,8/31/2006 11:24:00,9/1/2006 8:00:00,9/1/2006 15:09:00

Whe reyou see 555555555555, I used that to replace the real tracking numbers, for confidentially reasons.
 
Upvote 0
I'm sorry but I really don't see the point in this code.

You should just be able to import a file into a table using TransferSpreadsheet or TransferText.

There should be no reason for looping through a file line by line like that.

If there is some sort of manipulation in the code that I'm not seeing, and I can't see any in that specific code, then that could probably be dealt with using append/update/delete queries.
 
Upvote 0

Forum statistics

Threads
1,214,534
Messages
6,120,080
Members
448,943
Latest member
sharmarick

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top