This topic is locked
[SOLVED]

 ASP adding text to query string causing failure

1/7/2007 1:16:38 PM
ASPRunnerPro General questions
author

I'm running a query that works fine in Access, but when it's run on the server using ASPRunner, it adds "top 20" at the start of the query. Is there any way to stop asprunner from adding anything to the query string? Thanks.
SELECT top 20 DISTINCT [09a].cid, [09a].LASTNAME, [09a].FIRSTNAME, [09a].MAILADDR1, [09a].MAILADDR2, [09a].MAILCITY, [09a].MAILSTATE, [09a].MAILZIP, [09a].MAILZIP4, [09a].MAILCART, [09a].MAILDPT, [09a].PHONE, [09a].EMAIL, [09a].AGE, [09a].AGER, [09a].SEX, [09a].PARTYNUM, [09a].PRECNAME, [09a_cold3].issue, [09a_cold3].local, [09a_cold3].CHGDATE, [09a_cold3].USERNAME FROM 09a, 09a_cold3 WHERE [09a].CID2=[09a_cold3].CID2;

501280 1/7/2007

Yet another example of unwanted text being added to query (see text at end in red):
SQL query SELECT DISTINCT [09a].cid, [09a].LASTNAME, [09a].FIRSTNAME, [09a].MAILADDR1, [09a].MAILADDR2, [09a].MAILCITY, [09a].MAILSTATE, [09a].MAILZIP, [09a].MAILZIP4, [09a].MAILCART, [09a].MAILDPT, [09a].PHONE, [09a].EMAIL, [09a].AGE, [09a].AGER, [09a].SEX, [09a].PARTYNUM, [09a].PRECNAME, [09a_cnew].ISSUE, [09a_cnew].CHGDATE, [09a_cnew].USERNAME FROM 09a_cnew INNER JOIN 09a ON ([09a_cnew].LD=[09a].LD) AND ([09a].CID=[09a_cnew].CID) WHERE (((([09a].CID)=[09a_cnew].CID)); ) and (1=0)

Sergey Kornilov admin 1/7/2007

For complex SQL statements I would suggest to create query in MS Access and use it as a datasource in ASPRunnerPro.

501281 1/7/2007

For complex SQL statements I would suggest to create query in MS Access and use it as a datasource in ASPRunnerPro.


I did that: pasted the SQL right out of Access. Is that what you mean?
I reverted back to ASPRunnerPro 4.0 for the query pages and it seems to work fine.

Sergey Kornilov admin 1/7/2007

I meant create a query in MS Access and save it there as qryFirst, qrySecond etc.

After that use qryFirst as a datsource in ASPRunnerPro.

501282 1/7/2007

Got it. I've gone back to using the ASPRunnerPro query and it works perfectly now. Thanks.