Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB Recordset returns NULL, Access Query Returns Records?

Status
Not open for further replies.

TimGoff

Technical User
Jul 16, 2002
166
GB
Hello,

I open a ADODB recordset using the following SQL (using the connection string CurrentProject.Connection), and the recordset is NULL.

If a paste the SQL into an Access query and run - it returns 4 records.

I don't understand - is anybody able to shed light on this please?

Thanks in advance,
Tim

SELECT tblAcquisitions.AcquisitionNumber AS [Number], tblAcquisitions.Title, tblAcquisitions.ReceivedDate AS [Received Date], tblCompany.CompanyName AS [Company Name], tblStatus.Status, tblTape_Location.Name AS [Tape Location]
FROM tblStatus
RIGHT JOIN (((tblAcquisitions INNER JOIN tblCompany ON tblAcquisitions.CompanyID = tblCompany.CompanyID)
LEFT JOIN (SELECT Max(tblTape_Location.Tracking_ID) AS MaxOfTracking_ID, tblTape_Location.Tape_Number
FROM tblTape_Location
GROUP BY tblTape_Location.Tape_Number) Max_Tracking_ID
ON tblAcquisitions.Tape_Number = Max_Tracking_ID.Tape_Number) LEFT JOIN tblTape_Location ON Max_Tracking_ID.MaxOfTracking_ID = tblTape_Location.Tracking_ID) ON tblStatus.StatusID = tblAcquisitions.StatusID
WHERE tblTape_location.Name Like '*sarah*'

 
ADO uses "%" as the mask character ... not "*". Try
Code:
WHERE tblTape_location.Name Like '%sarah%'
 
Top man - thanks very much Golom.
Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top