Have been trying this for more than a few hours now. I am trying fill a dataset using Access Query. the query works fine in Access but does not fill anything in the Dataset. The query is a filter of a view. Example:-
Select Column1 as MyList
from (Select * from mytable
where Column1 like "'*" & Textbox1.Text &"*'"
or Column2 like "'*" & Textbox1.Text &"*'"
or Column3 like "'*" & Textbox1.Text &"*'")
union all
Select Column2
from (Select * from mytable
where Column1 like "'*" & Textbox1.Text &"*'"
or Column2 like "'*" & Textbox1.Text &"*'"
or Column3 like "'*" & Textbox1.Text &"*'")
union all
Select Column3
from (Select * from mytable
where Column1 like "'*" & Textbox1.Text &"*'"
or Column2 like "'*" & Textbox1.Text &"*'"
or Column3 like "'*" & Textbox1.Text &"*'")
I use the set the query as a string and use DataAdapter to fill in the Dataset. But this doesn't work. I don't get any error. The data just doesn't show up in the Dataset.
Code:-
Dim da as new OledbAdapter(sqlstring,myconn)
Dim ds as New Dataset
myconn.open()
da.fill(ds,"TableName")
myconn.close()
I believe this has something to do with access query when the lookup table is a view. Any suggestions/workarounds would be appreciated.
Cheers, Aamir