呵呵,用adodc不是更好吗?datagrid也是来源于adodc呀!
label1.caption=adodc1.recordset(0)
adodc1.recordset.movenext
label2.caption=adodc1.recordset(0)
adodc1.recordset.movenext
label3.caption=adodc1.recordset(0)
你是不是这个意思呀?
我比较笨,我理解你是这个目的,方法笨了些。

解决方案 »

  1.   


    haor(一个好人)你好!久闻,我的问题是这样,在DataGrid中有两列,一列为学
    号、另一列为姓名,如:
        学号                 姓名
      121                    王
      122                    李
      123                    白
    ................................
    想用三个Label(Label1、Label2、Label3)同时将姓名显示出来,Label1显示"王"、
    Label2显示"李"、Label3显示"白"。
      

  2.   


    flyinthesky(不哭不笑)你好!
    我的问题是这样,在DataGrid中有两列,一列为学号、另一列为姓名,如:
        学号                 姓名
      121                    王
      122                    李
      123                    白
    ................................
    想用三个Label(Label1、Label2、Label3)同时将姓名显示出来,Label1显示"王"、
    Label2显示"李"、Label3显示"白"。按你所说试了,但Label1、Label2、Label3
    同时显示的都是"王"字。(给2分)
    另外有个问题,如何才能将分给你,是直接写在这上面吗?请愿谅,我是一个新手。
      

  3.   

    好象可以用datagrid控件的行属性和列属性来确定显示的内容,把内容值赋给label控件就成了。
    以前在书上看到的,具体方法有些记不清了,试一试吧。
      

  4.   

    每次只显示三条记录的姓名,你不如使用循环....
     
     for i=1 to 3
        lael1.caption=adodc1.recordset(0)
        adodc1.movenext
        if adodc1.eof then
             label2.caption=""
             label3.caption=""
             exit for
        end if
        '--------------------
        lael2.caption=adodc1.recordset(0)
        adodc1.movenext
        if adodc1.eof then
             label3.caption=""
             exit for
        end if
        '--------------------
        lael3.caption=adodc1.recordset(0)
        adodc1.movenext
        if adodc1.eof then
             exit for
        end if
     next
       
      

  5.   

    a_gui你好!照你的方法试过了,但电脑显示MoveNext编译错误,未找到方法或数
    据库成员。
      

  6.   

    CPLiu你好!请说得具体些并给出原代码。
      

  7.   

    a_gui(阿桂) 你好!首先十分感谢您的热情帮助 现将原代码贴出,还望多多指教。
    Private Sub Command1_Click()
    Text1.Text = ""
    End SubPrivate Sub Command2_Click()
    End
    End SubPrivate Sub Command3_Click()
        On Error GoTo ErrMsg
        Adodc1.Recordset.Update
        Exit Sub
    ErrMsg:
        MsgBox Err.Description, vbExclamation, " 花名册- Update"
        End SubPrivate Sub Text1_Change()
    SQL = "Select * From 花名册 Where 学号 Like '" & Text1.Text & "%'"
    Adodc1.RecordSource = SQL
    Adodc1.Refresh
    End Sub
      

  8.   

    我不明白,flyinthesky(不哭不笑)的方法怎么可能不行?