用sql查询语句。
select * from 表名 where 用户名 like '%张%'

解决方案 »

  1.   

    要用控件啊,如果用Data控件
    data1.RecordSource="Select * from Table where 条件 order by 字段" 
    如果用ADO,也是设定RecordSource属性。
    别忘了设定完毕后刷新一下Data1.Refresh
      

  2.   

    Find 方法示例
    该示例是根据在 TextBox 控件中输入的一个单词,在 RichTextBox 控件中查找一个字符串。找到指定的字符串后,显示一个消息框。在消息框中给出指定单词所在行的行号。要试用此例,应在窗体上放置一个 RichTextBox 控件、一个 CommandButton 控件和一个 TextBox 控件。加载一个文件到 RichTextBox 中,并将这部分代码粘贴到窗体的通用声明部分中。然后运行此例,在 TextBox 中输入一个单词,再单击 CommandButton。Private Sub Command1_Click()
       Dim FoundPos As Integer
       Dim FoundLine As Integer
       '查找 TextBox 控件中指定的文本。
       FoundPos = RichTextBox1.Find(Text1.Text, , , rtfWholeWord)   '根据是否找到文本,显示相应的消息。   If FoundPos <> -1 Then
          '返回已找到文本所在行的行号。
          FoundLine = RichTextBox1.GetLineFromChar(FoundPos)
          MsgBox "Word found on line " & CStr(FoundLine)
       Else
          MsgBox "Word not found."
       End If
    End Sub