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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inconsistent results in Query Analyzer and ASP page

Status
Not open for further replies.

achmo

Programmer
Aug 30, 2001
56
IL
Hello,

I'm using this query on an ASP page (the database is SQL Server):
Code:
SELECT g.groupcode,g.groupname,isnull(sum(p.vallastyear),0) AS Kamutlastyear,
isnull(sum(p.valthisyear),0) AS Kamutthisyear FROM tblgroups g, tbltrufot t, tblparetob p WHERE t.newtechnology=0 AND g.groupcode=t.groupcode AND p.trufacode=t.trufacode GROUP BY g.groupname,g.groupcode ORDER By g.groupcode DESC

The query works without "t.newtechnology=0"; after adding it, the query still works on the SQL Server's Qyery Analyzer but on the asp page I get an empty recordset. On the database, the field in question (newtechnology) contains 0 or 1, and when I change the query to "t.newtechnology=1" it works just fine.

What on earth can cause this inconsistency?

Thanks for your help

Yael
 
What is your connection string? ________
George, M
 
my connection string is "dsn=Trufot;UID=sa;PWD=;", but because the query does work when I change it (without changing anything else in the page), I don't think the problem is with the recordset or the connection.

Yael
 
I dont know what to say to you cuz i use Querry Analizer to for my ASP querries and a just copy-paste them.
Have u tryed another querryes? ________
George, M
 
Have you tried to trap ADO errors?
Err, Errors collections?
 
Shaddow - yes, other querries work fine... I know, the fact that the same query works in the Analyzer but not on the page is very strange. I even tried using a stored procedure, and again executing the procedure from the Analyzer worked just fine, but on the ASP page returned an empty recordset (while executing other stored procedures from the same command on the asp page worked ok!)

dianal - I'm not sure, but wouldnt i get an error message while the page is loading if there was an error?

Thanks for trying, anyway :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top