点滴的积累,不断改进才是最好的编程过程。
网上摘录的一段代码,先存着
1
Sub OpenRecord()
2
Dim Record As New ADODB.Record
3
4
Call Record.Open("", "URL=http://localhost/", , adOpenIfExists Or adCreateCollection)
5
6
Dim Recordset As New ADODB.Recordset
7
Set Recordset = Record.GetChildren
8
9
While Not Recordset.EOF
10
Debug.Print Recordset(0)
11
Recordset.MoveNext
12
Wend
13
End Sub
14
15
Sub OpenStream()
16
17
Dim Record As New ADODB.Record
18
Call Record.Open("Text.txt", "URL=http://localhost/Access/", , adModeRead)
19
20
Dim Stream As New ADODB.Stream
21
Call Stream.Open(Record, adModeRead, adOpenStreamFromRecord)
22
23
Dim Text As String
24
Stream.Charset = "ascii"
25
Text = Stream.ReadText(adReadAll)
26
27
Debug.Print
28
29
End Sub
30
Sub OpenRecord()2
Dim Record As New ADODB.Record3

4
Call Record.Open("", "URL=http://localhost/", , adOpenIfExists Or adCreateCollection)5

6
Dim Recordset As New ADODB.Recordset7
Set Recordset = Record.GetChildren8

9
While Not Recordset.EOF10
Debug.Print Recordset(0)11
Recordset.MoveNext12
Wend13
End Sub14

15
Sub OpenStream()16

17
Dim Record As New ADODB.Record18
Call Record.Open("Text.txt", "URL=http://localhost/Access/", , adModeRead)19

20
Dim Stream As New ADODB.Stream21
Call Stream.Open(Record, adModeRead, adOpenStreamFromRecord)22

23
Dim Text As String24
Stream.Charset = "ascii"25
Text = Stream.ReadText(adReadAll)26

27
Debug.Print28

29
End Sub30

