the code worked perfect on Friday and when I come back today and try.. the RAM alone works fine in the T-SQL but the Mfg, Make, GraphicsCard and GraphicsVersion do not work atall.. they dont give me any queries atall in the data grid view o/p..

why am i stuck ? Any reason ?

i am worked fine on Friday..! :(((

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim con As OleDbConnection = New OleDb.OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=Z:\CAD\Copy of USERS.mdb")

Dim cmd As New OleDbCommand

cmd = New OleDbCommand("Select * from table1 Where Mfg Like '%" & ComboBox1.SelectedItem & "%' And Make Like '%" & ComboBox2.SelectedItem & "%' And RAM Like '%" & ComboBox3.SelectedItem & "%' And GraphicsCard Like '%" & ComboBox4.SelectedItem & "%' And GraphicsVersion Like '%" & ComboBox5.SelectedItem & "%'", con)


Dim da As OleDbDataAdapter = New OleDbDataAdapter(cmd)


Dim ds As DataSet = New DataSet()


da.Fill(ds, "table1")

DataGridView1.DataSource = ds.Tables("table1").DefaultView



cmd = Nothing



End Try

End Sub

It works now again.. but why is this on and off again and again ??

any reasons ?? Pls assist!! :((


If you're getting a recordset back with no data that is an indicator that something is wrong with your SQL syntax.

I'd put a break in the code and see exactly what string you are passing to the connection and work from there. Try throwing in some logic to correct potentially bad conditions in your comboboxes etc. I bet that is where your problem is coming from.

Let us know how it works out.

This article has been dead for over six months. Start a new discussion instead.