|
Home > Archive > dBASE Web Applications > April 2005 > Having SEARCH problem with WebReports.cc
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Having SEARCH problem with WebReports.cc
|
|
| Dan Anderson 2005-04-06, 8:01 pm |
| I asked a question about streaming data to a web report a couple of weeks
back and got a great response. However, I had to get sidetracked to a
different project and didn't actually get to fool with this stuff until now.
I went through the expample in Michael Nuwer's "Creating Reports for the
Web: WebReports.cc" and substuted my data, etc. I worked flawlessly. Then
when I tried using the "SEARCH" from the .html page it kicked out errors.
First I tried using a textfield in the calling .html file; then, I switched
to a hidden value, since the value will already be established in the
calling screen. I have tested to make sure the hidden variable is being
received and it is. But it blows up anyway. I have placed the following
code right below the oCGI.connect() line.
IF oCGI.isKey('SEARCH')
oCGI.filter = [QuoteNum = ] + oCGI['SEARCH']
ENDIF
QuoteNum is a field name in the active table. Here's the whole code:
Try
Set proc to WebReports.cc additive //subclass of WebClass.cc
oCGI = new WebReportsCGISession
()
oCGI.Connect()
IF oCGI.isKey('SEARCH')
oCGI.filter = [QuoteNum = ] + oCGI['SEARCH']
ENDIF
oCGI. setWebMasterAddress(
"webmaster@ubinc.com")
aFieldArray = new Array()
aFieldArray = {"QuoteNum","PR","IName","SubmitDate","Status"}
aCaptionArray = new Array()
aCaptionArray = {"Quote Number","Producer","Name of
Insured","Submitted","Status"}
oCGI.Database = "dUBI"
oCGI.sqlString = 'Select * From Quotes.dbf'
IF oCGI.Lookup()
oCGI.init(aFieldArray)
oCGI.bAlternateShading = false
oCGI.homePage = "http://www.ubiquote.com/monthly/select.htm"
oCGI. ResponsePageTop('Ope
n Submissions for ' + oCGI['SEARCH'])
oCGI. ResponsePageTable(aC
aptionArray,aFieldAr
ray)
oCGI. ResponsePageBottom()
ELSE
oCGI.SorryPage("No Records found")
ENDIF
catch(exception e)
oCGI.errorPage(e)
endtry
oCGI = null
aCaptionArray = null
aFieldArray = null
Quit
From the line "oCGI. ResponsePageTop('Ope
n Submissions for ' +
oCGI['SEARCH']) " it properly displays the value of "SEARCH." Here's the
error message. Any suggestions?
File: D:\htdocs\ubiquote\p
ublic\cgi-bin\WebReports.cc
Line No: 161
Database Engine Error: Operation not applicable.
Line No:161
Database Engine Error: Operation not applicable.
--
Dan Anderson
UBI Processing Dept.
andersond@ubinc.com
800-444-4824 ext 101
| |
| Michael Nuwer [dBVIPS] 2005-04-06, 8:01 pm |
| Dan Anderson wrote:
>
> File: D:\htdocs\ubiquote\p
ublic\cgi-bin\WebReports.cc
> Line No: 161
> Database Engine Error: Operation not applicable.
> Line No:161
> Database Engine Error: Operation not applicable.
>
Hi Dan,
Line 161 is where the filter condition is used to set the filter property:
this.q.rowset.filter = this.Filter
As best as I can tell, the code you have looks fine. The error message
you are getting is, to me, the single most troublesome error produced by
dbase (or the BDE)!! In my experience it is related to a malformed
filter condition.
I'd check the condition, i.e. replace the three streaming lines with this:
oCGI.sorrypage(oCGI.filter)
This will show you the condition. If it looks good, test that same
condition interactively (in a regular prg file or at the command window)
against the table.
| |
| Michael Nuwer [dBVIPS] 2005-04-06, 8:01 pm |
| Dan Anderson wrote:
> I asked a question about streaming data to a web report a couple of weeks
> back and got a great response. However, I had to get sidetracked to a
> different project and didn't actually get to fool with this stuff until now.
> I went through the expample in Michael Nuwer's "Creating Reports for the
> Web: WebReports.cc" and substuted my data, etc. I worked flawlessly. Then
> when I tried using the "SEARCH" from the .html page it kicked out errors.
> First I tried using a textfield in the calling .html file; then, I switched
> to a hidden value, since the value will already be established in the
> calling screen. I have tested to make sure the hidden variable is being
> received and it is. But it blows up anyway. I have placed the following
> code right below the oCGI.connect() line.
>
> IF oCGI.isKey('SEARCH')
> oCGI.filter = [QuoteNum = ] + oCGI['SEARCH']
> ENDIF
>
> QuoteNum is a field name in the active table. Here's the whole code:
>
> Try
>
> Set proc to WebReports.cc additive //subclass of WebClass.cc
> oCGI = new WebReportsCGISession
()
> oCGI.Connect()
>
> IF oCGI.isKey('SEARCH')
> oCGI.filter = [QuoteNum = ] + oCGI['SEARCH']
> ENDIF
>
> oCGI. setWebMasterAddress(
"webmaster@ubinc.com")
>
> aFieldArray = new Array()
> aFieldArray = {"QuoteNum","PR","IName","SubmitDate","Status"}
>
> aCaptionArray = new Array()
> aCaptionArray = {"Quote Number","Producer","Name of
> Insured","Submitted","Status"}
>
> oCGI.Database = "dUBI"
> oCGI.sqlString = 'Select * From Quotes.dbf'
>
>
You might alternatively be able to use a "where" clause in your SQL:
IF oCGI.isKey('SEARCH')
oCGI.sqlString = 'Select * From Quotes.dbf where ;
QuoteNum = ' + oCGI['SEARCH']
else
oCGI.sqlString = 'Select * From Quotes.dbf'
ENDIF
|
|
|
|
|