Importing Text File Error (2 Viewers)

taShi

New member
Local time
Today, 09:30
Joined
Apr 24, 2002
Messages
8
I am trying to import a fixed format text file. I get an error saying that "One or more rows of data contain too many characters to import. The maximum characters per row is 65,000."

Is this a legitimate message. I have been getting goofy errrors from Access. Does anyone know of a workaround for this message.

Thx!!!!:confused:
 

neileg

AWF VIP
Local time
Today, 09:30
Joined
Dec 4, 2002
Messages
5,975
How are you trying to import it? If it is a fixed length file, I would be importing it into a table that I had predefined with the right structure. Otherwise, how does it know where the fields and records end?

I suspect Access is reading the whole file as one record, hence the message.
 

WitchCraft

Registered User.
Local time
Today, 09:30
Joined
Jan 6, 2003
Messages
11
Are you trying to import or read the file?
If it's just reading it, do something like this to read it line by line :


open "[your file's path]" for input as #File1
line input #File1, [Var to hold value]
 

WayneRyan

AWF VIP
Local time
Today, 09:30
Joined
Nov 19, 2002
Messages
7,122
taShi,

If you just want to see what the file is made of:


Dim ByteChar As Byte
Dim BytePtr As Long
Dim InChar As String

Open "C:\YourFile.txt" For Binary Access Read As #1

BytePtr = 0
While NOT EOF(1)
Get #1, BytePtr, ByteChar
BytePtr = BytePtr + 1
InChar = Chr(ByteChar)
If (InChar = "10") Or (InChar = "13") Then
MsgBox("Record delimiter found at " & BytePtr
Close #1
Exit Sub
End If
Wend
MsgBox("No record delimiter found in " & BytePtr & " Characters")
Close #1

hth,
Wayne
 

Users who are viewing this thread

Top Bottom