Get the App
SLTechnology News&Howtos  ›  Development  › 

How adodb.stream reads a file to an array

Shulou Source: shulou.com Published: 2022-06-03 07:46:17 11月15日 Update

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.

Tags: Articles arrays files more good practical content text articles patterns knowledge types references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker NVidia Huawei OPPO Reno Linux