adodb原来不能和msflex绑定……天哪。。
换成data就可以。。我晕了。。怎么办。。
datagrid又不了解。。
Set Con = New ADODB.Connection
strcon = "driver=mysql odbc 3.51 driver;" & _
                "server=" & text3.Text & ";" & _
                "database=dtserver;" & _
                "port=3306;" & _
                "uid=root;" & _
                "pwd=waj"
Con.Open strcon
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
strrs = "select * from tab_user where user_user='" & text1.Text & "'"
rs.Open strrs, Con, 3, 2
If rs.RecordCount = 0 Then
    MsgBox "用户名不存在!", , "请重试!"
    Else
        If rs("user_pwd") = text2.Text Then
            '成功登陆
            '加事件代码
            
            g_ip = text2.Text
            
            
        Else
            MsgBox "密码错误!", , "错误"
        End IfEnd If
'Set rs = Nothing
'Set Con = Nothing
set msflexgrid1.DataSource= rs换成datagrid就没问题……有没方法解决 ??
用datagrid的话,一次都没用过……只能用data的话 谁能帮我用把下面的msflex换成data...

解决方案 »

  1.   

    怎么表示datagrid 中的 某一行  某一列的值
    比如说 第一行,第二列单元格。
      

  2.   

    以为死人了,进来看看,发现上当。MSFlexGrid是不能绑定ADODB,用MSHFlexGrid吧...
      

  3.   

    你是说MSFlexGrid?
    改用MSHFlexGrid就可以了,在部件中添加
      

  4.   

    Set datagrid.DataSource = rs
      

  5.   

    datagrid用来绑定数据库比较好,可以在datagrid上直接修改,但是不支持颜色,而且是客户端游标,多个表组合查询就不能直接改了,滚动条和msflex一样不能实时拖动。如果不是在表格上直接修改,和不用颜色表示的话可以考虑listview控件。速度快,而且支持图标,实时滚动。