(1)求vb数据库打开,读,写语句及用法
(2)input语句读text文件为何多读出空格?:100个编码数据库写入
Private Sub Command1_Click()
Open "d:\笔记本100个编码数据库.txt" For Append As #1 Text1.Text = ""
Dim i As Integer
For i = 1 To 100
Print #1, "第" & CStr(i) & "行,";
For j = 1 To 5
Print #1, "25,26,27,28,29,30,31, ,";
If j = 5 Then Print #1, vbCrLf
Next j
Text1.Text = Text1.Text & "第" & CStr(i) & "行" & vbCrLf
Text1.SelStart = Len(Text1.Text)
Rem Text1.Refresh Next i
Close #1
End Sub从100个编码数据库读出
Dim d(0 To 7)
Dim i As Integer
Dim j As Integer
Private Sub Command1_Click()Open "d:\笔记本100个编码数据库.txt" For Input As #1
Rem Text1.Text = ""
For i = 1 To 100
Rem Do While Not EOF(1)
For j = 1 To 5Input #1, d(0), d(1), d(2), d(3), d(4), d(5), d(6)Text1.Text = Text1.Text & d(0) & d(1) & d(2) & d(3) & d(4) & d(5) & d(6) & vbCrLf
Text1.SelStart = Len(Text1.Text)
Rem Text1.Refresh
Next j
Rem Loop
Next i
Close #1
End Sub
(2)input语句读text文件为何多读出空格?:100个编码数据库写入
Private Sub Command1_Click()
Open "d:\笔记本100个编码数据库.txt" For Append As #1 Text1.Text = ""
Dim i As Integer
For i = 1 To 100
Print #1, "第" & CStr(i) & "行,";
For j = 1 To 5
Print #1, "25,26,27,28,29,30,31, ,";
If j = 5 Then Print #1, vbCrLf
Next j
Text1.Text = Text1.Text & "第" & CStr(i) & "行" & vbCrLf
Text1.SelStart = Len(Text1.Text)
Rem Text1.Refresh Next i
Close #1
End Sub从100个编码数据库读出
Dim d(0 To 7)
Dim i As Integer
Dim j As Integer
Private Sub Command1_Click()Open "d:\笔记本100个编码数据库.txt" For Input As #1
Rem Text1.Text = ""
For i = 1 To 100
Rem Do While Not EOF(1)
For j = 1 To 5Input #1, d(0), d(1), d(2), d(3), d(4), d(5), d(6)Text1.Text = Text1.Text & d(0) & d(1) & d(2) & d(3) & d(4) & d(5) & d(6) & vbCrLf
Text1.SelStart = Len(Text1.Text)
Rem Text1.Refresh
Next j
Rem Loop
Next i
Close #1
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货