I have a dataset (TADODataset) that feeds into an in memory dataset(TdxMemData) which is assigned to a datasource (TDataSource). When I run the program and the SQL is not ordered by anything, the three records returned are displayed on 3 separate report pages (ReportBuilder). However when I order by a field, The first two records of the report are appended together and only the final record displays correctly.
This is cryptic and not very informative, but I'm trying to see if I am missing something simple. The code shouldn't produce different results because I ordered the SQL but it is. It leads me to believe I have missed a setting for the component. Does anyone know of any issues that could be caused by sorting a SQL DataSet and the way it could interact with an In memory dataset? I am very new to using these component types and am just looking for someone with more experience than me to let me know where I should take this. Any help would be greatly appreciated, and if anything is unclear I will try to clarify. Thanks in advance.
Update 8.14.2013:
SQL statement (before Order By):
SELECT r.RecordID, r.VisibleRouteID, r.DriverSideStudentsPerSeat,
r.ServiceSideStudentsPerSeat, v.Vehicle, v.DriverSideRows,
v.ServiceSideRows, v.RecordID AS VehicleID
FROM Route r
LEFT OUTER JOIN Vehicles v ON v.RecordID = r.VehicleID
WHERE r.RecordID = :RouteID
SQL Statement (After Order By has been added):
SELECT r.RecordID, r.VisibleRouteID, r.DriverSideStudentsPerSeat,
r.ServiceSideStudentsPerSeat, v.Vehicle, v.DriverSideRows,
v.ServiceSideRows, v.RecordID AS VehicleID
FROM Route r
LEFT OUTER JOIN Vehicles v ON v.RecordID = r.VehicleID
WHERE r.RecordID = :RouteID
ORDER BY r.VisibleRouteID