ADO.NET not retrieving results correctly

From: Matt Michael (no_at_spamforme.com)
Date: 02/03/05


Date: Wed, 02 Feb 2005 22:21:08 -0500

I'm using ADO .NET to connect to a Microsoft Access database, and
everything so far has been working in my program except one small
problem. I am constructing a query string to search for certain results
from a table, and it does not seem to return the correct results.

Dim dtResults As New DataTable("SearchResults")

Dim cmdSearchResults As New OleDb.OleDbCommand(queryString,
appointments.myConnection)
Dim daSearchResults As New OleDb.OleDbDataAdapter(cmdSearchResults)

daSearchResults.Fill(dtResults)

Debug.WriteLine(dtResults.Rows.Count)
Debug.WriteLine(queryString)

where queryString is the string I have constructed. It looks like this:

SELECT Appointments.AppointmentID, Appointments.AppointmentTime,
Buildings.Building, Appointments.RoomNumber, Appointments.Details FROM
(Appointments INNER JOIN Buildings ON
Appointments.BuildingID=Buildings.BuildingID) INNER JOIN Technicians ON
Appointments.TechnicianID=Technicians.TechnicianID WHERE 1 = 1 AND
Technicians.TechnicianName = "Matt" AND Appointments.Details LIKE "*test*";

When I copy this directly into a query in MS Access it returns the
correct records, however the data adapter in my code returns 0 results.
   Whenever I remove the LIKE clause it seems that my queries do return
results back to the data table. Is there something buggy with using the
LIKE clause to send queries through ADO? Any ideas as to what the
problem is anyone?

-Matt



Relevant Pages

  • DataAdapter returns 0 results, what am I doing wrong?
    ... I'm using ADO .NET to connect to a Microsoft Access database, ... LIKE clause to send queries through ADO? ...
    (microsoft.public.dotnet.languages.vb)
  • Desperate for help on serious TCP/IP connectivity problem
    ... MSDE either SP2 or SP3a) via TCP/IP under ADO results in queries being ... the connection to the database is made via TCP/IP ... We suspect that deep in the TCP/IP stack something is pumping messages, ...
    (microsoft.public.sqlserver)
  • Re: Data Report help - VB6
    ... DataReport is pretty cool, but that's all I'll say about that. ... Access queries works great. ... through ADO. ... and the Queries button makes things really easy to design queries. ...
    (microsoft.public.vb.general.discussion)
  • Re: How to avoid soft parses with ADO
    ... It seems to be library cache contention. ... We have an application using Oracle DB through ADO - Oracle OLEDB ... queries that are execured most often), but too many SQL queries are ...
    (comp.databases.oracle.server)
  • Re: MS Access Query in VB6
    ... I'm using ADO... ... that same query recordset from the replicated database comes back ... queries. ... What data access method are you using? ...
    (microsoft.public.vb.general.discussion)