How adodb.stream reads a file to an array
This article will explain in detail how adodb.stream reads files into arrays. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Function filenum (filename,i)
Dim st,s
Set st= CreateObject ("ADODB.Stream")
St.Type = 2 'stream type is text
St.Mode = 3 'mode is read and write
St.Open
St.LineSeparator=13
St.LoadFromFile filename
Do While Not St.EOS
S = Split (st.readtext (), vbCrLf)
Loop
'MsgBox UBound (s) total
Filenum=s (I)
St.Close
End function
MsgBox filenum ("file.txt", 2)
This is the end of the article on "how to read adodb.stream into an array". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.