Hi,
I'm writing an aspx page which queries an access database. The SQL is generated
by the aspx page depending on values passed to it in querystrings, it is rather
long and complex, so I won't post it.
My SQL returns no hits when the page runs (although I'm confident there should
be hits). However if I dump my SQL string to the screen (using
Response.Write(strSQL)) and copy it, I can paste it into a query direct in
Access and get the hits that I would expect.
Does anyone know why this would be. I would expect the same SQL to get the same
hits whether it is sent from a web page or executed within the database.
Rhanks
Jason
|
OK guys, here's the SQL. I didn't hink it would make any difference as I have
shown it works when pasted directly into a query in Access. It's only when the
web page performs the query that nothing is returned.
here it is
SELECT DISTINCTROW tITRs.sProjectid, tITRs.sModuleId, tITRs.sSystemId,
tITRs.sSubSystemId, tITRs.sDisciplineId, tITRs.sTagNoId, tITRs.sItemId,
tITRs.dITRDateCompleted, tITRs.bITRCompleted, tITRs.sITRLocation,
tITRs.sITRResponsibility, tITRs.dDateLastUpdated, tITRs.sLastChangedBy,
tITRs.bThirdPartyWitness,tITRs.sDisciplineId, tITRs.sCompanyID,
tITRs.dITRDateWitness, tProjects.sProjectDesc, tTagNos.bConstruct,
tTagNos.bDestruct, tTagNos.sTagNoDescription, tITRs.sCompanyID,
tModules.sModuleDescription, tSystems.sSystemDescription FROM ((((tITRs LEFT
JOIN tProjects ON tITRs.sProjectid = tProjects.sProjectId) LEFT JOIN tModules ON
(tITRs.sModuleId = tModules.sModuleId) AND (tITRs.sProjectid =
tModules.sProjectId)) LEFT JOIN tSystems ON (tITRs.sSystemId =
tSystems.sSystemId) AND (tITRs.sModuleId = tSystems.sModuleId) AND
(tITRs.sProjectid = tSystems.sProjectId)) LEFT JOIN tTagNos ON tITRs.sTagNoId =
tTagNos.sTagNoId) LEFT JOIN tITRIds ON tITRs.sItemId = tITRIds.sITRId
WHERE(((tITRs.sProjectid) LIKE "*") And ((tITRs.sModuleId) Like
"*") And ((tITRs.sSystemId) Like "*") And
((tITRs.sSubSystemId) Like "*") And ((tITRs.sDisciplineId) Like
"*") And ((tITRs.sTagNoId) Like "*") And
((tITRs.sITRLocation) Like "*")) ORDER BY tITRs.sProjectid,
tITRs.sModuleId, tITRs.sSystemId, tITRs.sSubSystemId, tITRs.sDisciplineId,
tITRs.sTagNoId, tITRs.sItemId
|