If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

Syntax problem with Oledbconnection

Hello,
I really need your help with this, I'm stucked with a code that doesn't work because of incorrect syntax
Basically what I have to do is make a research on database based on input(textbox1.text, textbox2.text, textbox3.text...) from user plus the user isn't necesserly going to enter all fields how can I manage this in the code
Here the code:
Dim connection As New OleDbConnection("Provider=SQLNCLI.1;Data Source=Imane-PC\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=Project;")

Dim command As New OleDbCommand("SELECT * FROM form,rel WHERE form.code = rel.code and form.code and form.desc = @desc LIKE @code and form.exp LIKE @exp", connection)