Model1
Public objConn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\database\MediaTeach.mdb")
Public objComm As New OleDb.OleDbCommand
Public objda As New OleDb.OleDbDataAdapter
Public objds As New DataSet
form1里代码
objComm.CommandText = "select * from FirstList"
objComm.Connection = objConn
objda.SelectCommand = objComm
objConn.Open()
objda.Fill(objds)
objConn.Close()
For i = 0 To objds.Tables(0).Rows.Count - 1
LabelXH(i + 1).Text = objds.Tables(0).Rows(i)(1)
labelID(i) = objds.Tables(0).Rows(i)(0)
Next
form2里代码
objComm.CommandText = "select * from SecondList"
objComm.Connection = objConn
objda.SelectCommand = objComm
objConn.Open()
objda.Fill(objds)
objConn.Close()
For i = 0 To objds.Tables(SecondList).Rows.Count - 1
LabelXH(i + 1).Text = objds.Tables(SecondList).Rows(i)(1)
labelID(i) = objds.Tables(SecondList).Rows(i)(0)
Next
form2里有错
未处理的“System.Data.OleDb.OleDbException”类型的异常出现在 system.data.dll
我的ACCESS里四张表,我想在每一个窗体里用一张表,表里记录的是控件名称,控件的编号
帮我看看哪里错了