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

Recommended Answers

All 2 Replies

dim query as string= "SELECT Rec1, Rec2, Rec3 FROM Table1 WHERE Rec1 LIKE '%" & txtTextBox.Text & "%'"

good that worked for me :) thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.