点滴的积累,不断改进才是最好的编程过程。
网上摘录的一段代码,先存着
1Sub 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
13End Sub
14
15Sub 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
29End Sub
30
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
13End Sub
14
15Sub 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
29End Sub
30