I want the user to type in part of a word, and I want to return all words
from an Access word table that contains specified letters. If they were to
type "fe??", it should return all words in the dictionary that are 4 letters
and begin with "fe" into a listbox. I am having difficulting searching for
all words and taking all those words and populating a listbox. Can you help?
Here's what I have:
CLASS -
Public Property word() As String
Get
Return m_Word
End Get
Set(ByVal Value As String)
m_Word = Value
End Set
End Property
Public Sub GetWord(ByVal Word As String)
con.Open()
cmdSelect.Parameters("@Word").Value = Word
Dim dr As OleDb.OleDbDataReader
dr = cmdSelect.ExecuteReader
While dr.Read
m_Word = dr("Word")
m_length = dr("Length")
End While
dr.Close()
con.Close()
End Sub
Private Sub Find2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Find2.Click
Dim finished As Boolean = False, line As String
'clean out the listbox first
Display.Items.Clear()
m_foundword = New FindWord
' While Not finished
m_foundword.GetWord(WordFind.Text)
'Do While WordFind.Text = m_foundword.word ' the loop didn't work so
i
''comented it
If WordFind.Text = m_foundword.word Then ' this will pull up one entry
' If WordFind.Text like m_foundword.word Then 'doesn't work
m_foundword.GetWord(WordFind.Text)
Display.Items.Add(m_foundword.word)
End If
'i = i + 1
'Loop