Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim cmd As New ADODB.Command
Dim rs As New ADODB.Recordset
cn.Open "DSN=xxxts", "", ""
cmd.ActiveConnection = cn
cmd.CommandText = "select CusSaleName" & "from Customer" & "where CusName LIKE ?"
cmd.CommandType = adCmdText
cmd.Parameters(0).Value = Text1.Text & "%"
Set rs = cmd.Excute
Do
Debug.Print rs("CusSaleName")
rs.MoveNext
Loop Until rs.EOF
rs.Close
cn.Close
End Sub