a741442652
a741442652
2017-04-26 12:55

vb6.0中关于循环的问题

  • vb6.0

Private Sub Form_Load()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim i%
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "provider=microsoft.ace.oledb.12.0;data source=" & App.Path & "\" & "DB_zhaolu.accdb;persist security info=false"
rs.Open " select * from 招录信息", cn, adOpenKeyset, adLockOptimistic
rs.MoveFirst
For i = 1 To 3
Dim a(3) As String
a(i) = rs.Fields(1)
Me.Controls("zwk" & i).Caption = a(i)
rs.MoveNext
Next i
End Sub
这段代码里面a(i)=rs.fields(1)出现了报错,百度了半天不知道为什么?求大神解答,怎么才能实现我想要的这个功能呢?是不是我的整个循环结构就是错的。。。。

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答