1,105,380 Community Members

Search in a MSAccess Database

Member Avatar
NorthDakota
Newbie Poster
6 posts since Sep 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi all :) I'd like to make a little vb.net program that executes searches on a msaccess database. I use a textbox to get the value to search and than i'd like to search all the values that has the textbox value in the middle. So, the queries should look like this:

SELECT Rec1, Rec2, Rec3 FROM Table1 WHERE Rec1 LIKE "*" & txtTextBox.Text & "*"

My problem is that i don't know how to pass the "*" character to my query, if I build a string that i pass to OleDbCommand(), the query returns nothing

*PS I use OleDbCommand to pass queries.

*PS2: eventually, sorry for my bad english :)

Member Avatar
GeekByChoiCe
Master Poster
701 posts since Jun 2009
Reputation Points: 152 [?]
Q&As Helped to Solve: 170 [?]
Skill Endorsements: 3 [?]
Featured
 
0
 
dim query as string= "SELECT Rec1, Rec2, Rec3 FROM Table1 WHERE Rec1 LIKE '%" & txtTextBox.Text & "%'"
Member Avatar
NorthDakota
Newbie Poster
6 posts since Sep 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

good that worked for me :) thank you

Question Answered as of 4 Years Ago by GeekByChoiCe
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: