Hi,
[quoted text, click to view] "bordsby" <bordsby@gmail.com> wrote in message
news:1129875979.387643.85990@g14g2000cwa.googlegroups.com...
> Windows Form Application, MSAccess Database, VB.NET
>
> I am having a very strange problem with the OleDb.OleDbDataAdapter.Fill
> method.... I have used this method thousands of times with success and
> have never had any problems, but recently I have a query that will
> definitely return multiple rows when run from inside MSAccess, but when
> passed through the OleDb.OleDbDataAdapter.Fill method, the result comes
> back with no rows, but I know *for sure* that the query does indeed
> come back with some rows. I have output the query one line before the
> fill method is called and then run it from inside MSAccess and rows are
> returned, but then nothing comes back in the fill method. This method
> has worked perfectly with many, many other queries...... so, what's
> different about this query? This is the first time I have passed use
> the 'Like' operator in the 'WHERE' clause of the query... if I take the
>
> 'Like' operator out, everything is fine, but when I put it in, the
> query still selects rows when run inside MSAccess, but the fill method
> gets nothing.
When using JET though ADO(.NET) you must use different wildcarts, % instead
of * and _ instead of ?.
HTH,
Greetings
[quoted text, click to view] >
> Has anybody ever experienced this particular symptom? I have always
> been successful in binding a datagrid to an MSAccess table, but as soon
> as I put the 'Like' operator in the query, everything is ignored... I
> pasted the few relevant lines of code here, but not the query, since
> that is not critical, becuase I am sure it returns rows and is
> syntactically correct.
> ____________________________________________________________________________
> Public connStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data
> source=data.db"
> Public conn As OleDb.OleDbConnection = New
> OleDb.OleDbConnection(connStr)
> Public q As OleDb.OleDbCommand = New OleDb.OleDbCommand("", conn)
> Public da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter
> Public ds As DataSet = New DataSet
> Public b2b_dt As DataTable = ds.Tables.Add("b2b")
>
> b2b_dt.Clear()
> q.CommandText = [long select query]
> da.SelectCommand = q
> da.Fill(Me.b2b_dt)
> _____________________________________________________________________________
>