VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This is used to search a database for a specific word

by David Deponeo (2 Submissions)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 31st March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This is used to search a database for a specific word

API Declarations


Dim rsTitles As Recordset

Rate This is used to search a database for a specific word



List1.Clear
SQLQuery = "Title LIKE '*" & Text1 & "*'"
rsTitles.FindFirst SQLQuery
If rsTitles.NoMatch = True Then Exit Sub
List1.AddItem rsTitles.Fields("Title")
Do Until rsTitles.NoMatch = True
rsTitles.FindNext SQLQuery
List1.AddItem rsTitles.Fields("Title")
Loop
End Sub

Private Sub Form_Load()
Set dbBiblio = OpenDatabase("C:\Program Files\Microsoft Visual Studio\VB98\Biblio.mdb")
SQLQuery = "SELECT * FROM Titles WHERE Title LIKE '*data*'"
Set rsTitles = dbBiblio.OpenRecordset(SQLQuery)
Do Until rsTitles.EOF = True
List1.AddItem rsTitles.Fields("Title") & "(" & rsTitles.Fields("[Year Published]") & ")"
rsTitles.MoveNext
Loop

Download this snippet    Add to My Saved Code

This is used to search a database for a specific word Comments

No comments have been posted about This is used to search a database for a specific word. Why not be the first to post a comment about This is used to search a database for a specific word.

Post your comment

Subject:
Message:
0/1000 characters