We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,289 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Search in a MSAccess Database

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 :)

2
Contributors
2
Replies
4 Hours
Discussion Span
3 Years Ago
Last Updated
3
Views
Question
Answered
NorthDakota
Newbie Poster
6 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
dim query as string= "SELECT Rec1, Rec2, Rec3 FROM Table1 WHERE Rec1 LIKE '%" & txtTextBox.Text & "%'"
GeekByChoiCe
Master Poster
721 posts since Jun 2009
Reputation Points: 208
Solved Threads: 169
Skill Endorsements: 1

good that worked for me :) thank you

NorthDakota
Newbie Poster
6 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 3 Years Ago by GeekByChoiCe

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0605 seconds using 2.63MB