Private Sub Form_Load()
        
        Me.Adodc1.ConnectionString = connstr        Me.Adodc1.RecordSource = "select * from 第一学年综合测评 where 学号 like '%" & form1.TxtPassword.Text & "%'"
        Me.Adodc1.CommandType = adCmdText
        Me.Adodc1.Refresh
        'If Adodc1.Recordset.RecordCount > 0 Then
        Text1.Text = Adodc1.Recordset.Fields.Item(1)
        Text2.Text = Adodc1.Recordset.Fields.Item(0)
        Text3.Text = Adodc1.Recordset.Fields.Item(2)
        Text4.Text = Adodc1.Recordset.Fields.Item(3)
        Text5.Text = Adodc1.Recordset.Fields.Item(10)
        Text6.Text = Adodc1.Recordset.Fields.Item(4)
        Text7.Text = Adodc1.Recordset.Fields.Item(5)
        Text8.Text = Adodc1.Recordset.Fields.Item(11)
        'Else
        'MsgBox "没找到相关信息"
        'End If
end sub
请问一下这段代码出什么问题了?
怎么不能实现在form2中显示form1的详细内容呀?

解决方案 »

  1.   

    Me.Adodc1.RecordSource = "select * from 第一学年综合测评 where 学号 like '%" & form1.TxtPassword.Text & "%'"
    下断点,看form1.TxtPassword.Text是什么。(学号like密码?)
    sql是什么。
      

  2.   

    form1.textpassword.text是显示姓名对应的学号。
    是SQL数据库
      

  3.   

    而form2的文本框显示的是数据库在第一第记录的值,再次单击运行出现错误
      

  4.   

    sql是什么,是问你,拼接出来的sql是什么?下断点到这里来看。
      

  5.   

    form1 就是第一个图片呀