Aaron Young
Jan 24th, 2000, 12:10 AM
You can store upto 2 Billion Characters in a String Variable, you will need to change the method of Loading the File into the Variable for Larger Files though, ie.
Private Sub Command1_Click()
Dim sData As String
Dim sChunk As String
Dim lChunk As Long
Dim lFileLen As Long
Dim iFile As Integer
iFile = FreeFile
'Open File For Binary Access
Open "C:\TestFile.csv" For Binary Access Read As iFile
lFileLen = LOF(iFile)
lChunk = 64000 'Load File in 64K Chunks
While Loc(iFile) < lFileLen
'Make sure the Buffer isn't Too Big
If Loc(iFile) + lChunk > lFileLen Then lChunk = lFileLen - Loc(iFile)
sChunk = Space(lChunk)
'Get the Next Chunk of Data
Get #iFile, , sChunk
'Append it to the Rest
sData = sData & sChunk
Wend
Close iFile
MsgBox "Done"
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com
Private Sub Command1_Click()
Dim sData As String
Dim sChunk As String
Dim lChunk As Long
Dim lFileLen As Long
Dim iFile As Integer
iFile = FreeFile
'Open File For Binary Access
Open "C:\TestFile.csv" For Binary Access Read As iFile
lFileLen = LOF(iFile)
lChunk = 64000 'Load File in 64K Chunks
While Loc(iFile) < lFileLen
'Make sure the Buffer isn't Too Big
If Loc(iFile) + lChunk > lFileLen Then lChunk = lFileLen - Loc(iFile)
sChunk = Space(lChunk)
'Get the Next Chunk of Data
Get #iFile, , sChunk
'Append it to the Rest
sData = sData & sChunk
Wend
Close iFile
MsgBox "Done"
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com