471,337 Members | 992 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

vb.net 2003 - populating with "like"

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
Jul 21 '05 #1
0 1243

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Michael Flanagan | last post: by
15 posts views Thread by Marc Le Roy | last post: by
1 post views Thread by Rick Brown | last post: by
reply views Thread by Bill Brinkworth | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.