WebHandler() question
Posted: Fri Dec 31, 2021 11:56 am
I am using the below code to send a response back to a Web browser.
I want to use the ::httpResponse object to tell the user to wait for the query results.
This works ok except it suppresses the final HTML output which never makes it to the web browser.
If I try to use ::httpResponse:send() to send back the query results, that doesn't work either.
Apparently, it can be only used once.
Any ideas?
I want to use the ::httpResponse object to tell the user to wait for the query results.
This works ok except it suppresses the final HTML output which never makes it to the web browser.
If I try to use ::httpResponse:send() to send back the query results, that doesn't work either.
Apparently, it can be only used once.
Any ideas?
Code: Select all
METHOD SqlService:query( cSql )
LOCAL cParams, cHtml
cParams := '/co:ADS_1 /sq:"' + cSql + '" /ee:reply.htm'
::httpResponse:contentType := 'text/html'
::httpResponse:writeStr( 'Please wait while executing your query...' )
::httpResponse:send()
Runshell(cParams,'sqlquery.exe')
IF File('reply.htm')
cHtml := MemoRead('reply.htm')
ELSE
cHtml := 'Cannot run your query'
ENDIF
RETURN cHtml