C
CJM
I have a query which produces different results in the Access query builder
and in an ASP page (via ADO)
An example of the query is:
----------------------------------------------------------
Select 'Ranked' as Source, H.HotelName, H.TelNo, H.URL, H.Location,
H.HotelID, Rank
from (Hotels H Inner Join PrefHotels P on H.HotelID = P.HotelID)
Inner Join Locations L on P.LocID = L.LocID
where Rank is not null and Rank > 0 and L.LocID=2
Union
Select 'Unranked' as Source, H.HotelName, H.TelNo, H.URL, H.Location,
H.HotelID, Rank
from (Hotels H Inner Join PrefHotels P on H.HotelID = P.HotelID)
Inner Join Locations L on P.LocID = L.LocID
where (Rank is Null or Rank = 0) and L.LocID=2
Order By Source, Rank
----------------------------------------------------------
In Access, I get the following results
Ranked, Hotel1, [other fields], 1
Ranked, Hotel2, [other fields], 2
Ranked, Hotel3, [other fields], 3
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
etc...
In my ASP Page I get these results:
Unranked, Hotel1, [other fields],
Unranked, Hotel2, [other fields],
Unranked, Hotel3, [other fields],
Unranked, Hotel4, [other fields],
Unranked, Hotel4, [other fields],
Unranked, Hotel4, [other fields],
etc...
I've imported the Access DB to SQL Server, and in Query Analyser and in the
ASP page I get the right result:
Ranked, Hotel1, [other fields], 1
Ranked, Hotel2, [other fields], 2
Ranked, Hotel3, [other fields], 3
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
etc...
(ie Same as in Access)
I'm assuming that if Access itself doesnt object to the SQL, it must be
right. Therefore, the problem lies with ADO and the Access OLEDB drivers...
Any ideas?
Chris
and in an ASP page (via ADO)
An example of the query is:
----------------------------------------------------------
Select 'Ranked' as Source, H.HotelName, H.TelNo, H.URL, H.Location,
H.HotelID, Rank
from (Hotels H Inner Join PrefHotels P on H.HotelID = P.HotelID)
Inner Join Locations L on P.LocID = L.LocID
where Rank is not null and Rank > 0 and L.LocID=2
Union
Select 'Unranked' as Source, H.HotelName, H.TelNo, H.URL, H.Location,
H.HotelID, Rank
from (Hotels H Inner Join PrefHotels P on H.HotelID = P.HotelID)
Inner Join Locations L on P.LocID = L.LocID
where (Rank is Null or Rank = 0) and L.LocID=2
Order By Source, Rank
----------------------------------------------------------
In Access, I get the following results
Ranked, Hotel1, [other fields], 1
Ranked, Hotel2, [other fields], 2
Ranked, Hotel3, [other fields], 3
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
etc...
In my ASP Page I get these results:
Unranked, Hotel1, [other fields],
Unranked, Hotel2, [other fields],
Unranked, Hotel3, [other fields],
Unranked, Hotel4, [other fields],
Unranked, Hotel4, [other fields],
Unranked, Hotel4, [other fields],
etc...
I've imported the Access DB to SQL Server, and in Query Analyser and in the
ASP page I get the right result:
Ranked, Hotel1, [other fields], 1
Ranked, Hotel2, [other fields], 2
Ranked, Hotel3, [other fields], 3
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
Unranked, Hotel4, [other fields], 0
etc...
(ie Same as in Access)
I'm assuming that if Access itself doesnt object to the SQL, it must be
right. Therefore, the problem lies with ADO and the Access OLEDB drivers...
Any ideas?
Chris