求助! datagrid 下标越界!
Option ExplicitDim rs1 As ADODB.Recordset
Dim cnn As ADODB.Connection
Dim i As Integer
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
For i = 0 To text1.UBound
Text1(i) = DataGrid1.Columns(i)
Next
End Sub
Private Sub Form_Activate()
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="";Data Source=E:\djda.mdb;Persist Security Info=flase"
Adodc1.RecordSource = "select * from tddjtz"
Set DataGrid1.DataSource = Adodc1
End Sub
说明 :text1数组空间的个数是0到14,datagrid有列数也是0到14.
个人感觉,应该是程序加载时顺序的问题,但不知道怎么改!谢
[ 本帖最后由 mingming2288 于 2014-6-3 22:10 编辑 ]