Hi Bob,
The stored queries are below:
I don't think this current problem is directly related to my queries though.
I thought it was a parameter issue, but when i removed all parameters from
the queries (hard coded values into selects) and ran 'exec
GetExhibitorsSearchByName' from asp i still got no results; if i run
GetExhibitorsSearchByName in Access all is well.
Thus it appears to be a problem with the querying method or recordset.
I would use your preferred method, but it doesn't provide much flexibility
when
intergrating with my paging class and generating the sql queries 'exec ....'
dynamically.
My code is based on the suggestions on this page.
http://authors.aspalliance.com/steve...les/sprocs.asp
I am almost at a loss, why this isn't working..
Any other thoughts??
Thanks for you help...and responses so far...!!!!
Cheers,
Adam
ASP:
SET recData = Server.CreateObject("ADODB.recordset")
'open recordset
recData.Open "exec GetExhibitorsSearchByName 20,38916,38916,'do'", DataConn,
3, 3
QUERIES:
ExhibitorsSearchByName
SELECT
c.ID, c.Company_Name, p.[level], 1 As QueryNbr
FROM
(Company AS c LEFT JOIN Sale AS s ON c.ID = s.Company_ID)
LEFT JOIN
Package AS p ON s.Package_ID = p.ID
WHERE
c.Category = 'EXH'
AND
(s.ID = (SELECT Max(ID) FROM Sale WHERE Company_ID = c.ID) Or
IsNull(s.ID))
AND
EXISTS(SELECT Company_ID FROM Event_Company_Link WHERE Event_ID
=@EventID AND Company_ID = c.ID)
AND
(INT(Start_Date) <= @StartDate) AND (INT(End_Date) >= @EndDate)
ORDER BY
p.[level] DESC , c.Company_Name, c.ID
UNION SELECT
c.ID, c.Company_Name, p.[level], 2 As QueryNbr
FROM
(Company AS c LEFT JOIN Sale AS s ON c.ID = s.Company_ID)
LEFT JOIN
Package AS p ON s.Package_ID = p.ID
WHERE
c.Category = 'EXH'
AND
(s.ID = (SELECT Max(ID) FROM Sale WHERE Company_ID = c.ID) Or
IsNull(s.ID))
AND
EXISTS(SELECT Company_ID FROM Event_Company_Link WHERE Event_ID =
@EventID AND Company_ID = c.ID)
ORDER BY c.Company_Name, c.ID;
GetExhibitorsSearchByName
SELECT ID, First(Company_Name), First([level]), First(QueryNbr)
FROM ExhibitorsSearchByName
GROUP BY ID
HAVING First(Company_Name) LIKE '*' & @CompanyName & '*';