Re: Select Qry: Differing results via Access & ADO (& SQL Server)
From: Ray at <%=sLocation%> [MVP] (%=sLocation%)
Date: 02/25/04
- Next message: Hans: "ASP Unicode!"
- Previous message: Ray at <%=sLocation%> [MVP]: "Re: ASP help required"
- In reply to: CJM: "Select Qry: Differing results via Access & ADO (& SQL Server)"
- Next in thread: CJM: "Re: Select Qry: Differing results via Access & ADO (& SQL Server)"
- Reply: CJM: "Re: Select Qry: Differing results via Access & ADO (& SQL Server)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Feb 2004 07:57:57 -0500
So you aren't seeing [Rank] from your query in your ASP pages? What code
are you using to display the recordset values?
-- Ray at home Microsoft ASP MVP "CJM" <cjmwork@yahoo.co.uk> wrote in message news:%234$MKx5%23DHA.3668@TK2MSFTNGP09.phx.gbl... > 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 > >
- Next message: Hans: "ASP Unicode!"
- Previous message: Ray at <%=sLocation%> [MVP]: "Re: ASP help required"
- In reply to: CJM: "Select Qry: Differing results via Access & ADO (& SQL Server)"
- Next in thread: CJM: "Re: Select Qry: Differing results via Access & ADO (& SQL Server)"
- Reply: CJM: "Re: Select Qry: Differing results via Access & ADO (& SQL Server)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading