编程是点滴的积累
今天主要是修补这些天写代码的注释,在这个过程中发现点滴的积累是多么重要,偷一点懒都是大问题,当修补的时候才发现好费劲。在处理数据层的数据的时候才发现点问题,自己一直不太了解Record和Recordset的区别,今天看了看觉得还是不错的,原来还有这个好东西,有意思。早上听广播的时候说很多白头发的老人都不能制作新版身份证,原来照相的时候要求背景必须是白色的,很多人的头发都照成蓝色的了,看来软件开发完了功能没问题,但是到了应用环境,问题就大了。
点滴的积累,不断改进才是最好的编程过程。
网上摘录的一段代码,先存着
点滴的积累,不断改进才是最好的编程过程。
网上摘录的一段代码,先存着
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