Folks:


I am trying to get all NVIDIA users on the list and I am saying NVIDIA* in my SQL statement since there are different versions of NVIDIA..

if instead of NVIDIA* i said 'NVIDIA Quadro fx 4600' i get a list of queries.. but if I said 'NVIDIA*' i dont get anything.. I see the DB blank in my datagridview though the connection is established properly..

I tried executing the same query in Access 'NVIDIA*" and it gives me the correct output with the entire list..


Why is this happening ?


Thanks
Kavitha.

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Dim con As New OleDbConnection("provider=microsoft.jet.oledb.4.0;data source=C:\Documents and Settings\bashkark\Desktop\Copy of USERS.mdb")

Dim cmd2 As New OleDbCommand

con.Open()

If (RadioButton1.Checked = True) Then

cmd2 = New OleDbCommand("select * from table1 where GRAPHICSCARD='NVIDIA*'", con)

End If

If (RadioButton2.Checked = True) Then

cmd2 = New OleDbCommand("select * from table1 where GRAPHICSCARD='3D *'", con)

End If

Dim da1 As OleDbDataAdapter = New OleDbDataAdapter(cmd2)

Try

Dim ds As DataSet = New DataSet

da1.Fill(ds, "table1")

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

Finally

con.Close()

cmd2 = Nothing

da1.Dispose()

con.Dispose()

End Try

End Sub

Recommended Answers

All 2 Replies

The wildcard is Access is the * but in T-SQL the % is the wildcard operator, and this is used in conjunction with the LIKE operator. Try...

select * from table1 where GRAPHICSCARD LIKE 'NVIDIA%'"

The wildcard is Access is the * but in T-SQL the % is the wildcard operator, and this is used in conjunction with the LIKE operator. Try...

select * from table1 where GRAPHICSCARD LIKE 'NVIDIA%'"

thanks ripper. got it!

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.