Column names should not be quoted
Dim strSQL2 As String = "SELECT * from ATable WHERE " &
ComboBox1.Text & " = ' " & TextBox1.Text & " '"
should work.
Ranjan
--
http://dotnetjunkies.com/weblog/dotnut
"Gordon" <(E-Mail Removed)> wrote in message
news

2A58BA2-124D-4487-A627-(E-Mail Removed)...
>
> What is the correct syntax for passing a select statement via the Reader.
>
> The following code doesn't return anything.
>
> Dim strSQL2 As String = "SELECT * from ATable WHERE ' " &
> ComboBox1.Text & " ' = ' " & TextBox1.Text & " '"
>
> Dim cmd As New OleDbCommand(strSQL2, Conn)
> Dim rdr As OleDbDataReader
> rdr = cmd.ExecuteReader
> ListBox1.Items.Clear()
> ListBox1.Items.Add("")
> While rdr.Read
> ListBox1.Items.Add(rdr("Col_One") & " " & rdr("Col_Two")
&
> " " & rdr("Col_Three") & " " & rdr("Col_Four"))
> End While
> rdr.Close()
>
>
> Thanks
> --
> Gordon