Welcome! Log In Create A New Profile

Advanced

Webdev: Search not started for this keyconfused smiley

Posted by vincent_stoop 
Webdev: Search not started for this keyconfused smiley
November 06, 2018 02:07PM
Hi all,

I'm working on a project in Webdev.

When I try to gather information from 2 databases into 1 Data Source, I keep getting the error "70019: SEARCH NOT STARTED FOR THIS KEY".

The connections to both databases are opened when loading the page, and closed when closing the page.

The method of the class I'm using for this is:

PROCEDURE PRIVATE HaalStandenOp()

dsStanden is Data Source
FOR EACH nMeternummer OF arrMeternummers
	sStandenQry is string = [
		SELECT 
			EnergieMeterPort.EnergieMeterID AS EnergieMeterID,
			EnergieMeterPort.EMSoort AS EMSoort,
			WEBMaand.Jaar AS Jaar,	
			WEBMaand.Maand AS Maand,
			WEBData.WebDataID AS WebDataID,
			WEBData.Kolom AS Kolom,	
			WEBData.Verbruik AS Verbruik,	
			WEBData.Stand AS Stand
		FROM 
			EnergieMeterPort,
			WEBData,	
			WEBMaand
		WHERE 
			WEBData.WEBMaandID = WEBMaand.WEBMaandID
			AND
				(
					WEBMaand.EnergieMeterID = EnergieMeterPort.InsightID
					AND EnergieMeterPort.InsightID = %1
				)
	]
	
	sStandenQry = StringBuild(sStandenQry, nMeternummer)
	HExecuteSQLQuery(dsStanden, hCheckDuplicates, sStandenQry)
	
	FOR EACH dsStanden 
		Trace(dsStanden.EMSoort, dsStanden.EnergieMeterID, dsStanden.Verbruik)
	END // This is where it throws the error, after the first trace is completed successfully...
	HCancelDeclaration(dsStanden)
	
END


There should be 8 records in the Data Source variable, but after tracing the requested data from the first record, it throws the following error:

The HFSQL security mechanism was triggered while browsing the 'dsStanden' file on the '' item.
Error returned by <kw1.energie-controle.nl:4900> server:
No browse started for <WebDataID> item on <WEBData> file.


Can someone help me with this?

Kind regards,

Vincent
Re: Webdev: Search not started for this keyconfused smiley
November 06, 2018 04:42PM
Hi Vincent,

I would say your there is nothing wrong with your code (although I would move the "is string" to the beginning instead of inside a loop - but afaik WD/WB doesn't bother)

HExecuteSQLQuery does return True?
Maybe dsStanden is also used somewhere else in your project and conflicts with this local one, while it is 'visible' at this point?

Arie
Re: Webdev: Search not started for this keyconfused smiley
November 06, 2018 04:59PM
Hi Vincent,

First observation; why are you "hCheckDuplicates" in a SELECT? I'm not sure what effect that would have on your query as it's used for Add/Modify operations. Try using "hQueryDefault".

Regards,
Darren.
Re: Webdev: Search not started for this keyconfused smiley
November 07, 2018 01:11PM
ArieM Wrote:
-------------------------------------------------------
>
> HExecuteSQLQuery does return True?
> Maybe dsStanden is also used somewhere else in
> your project and conflicts with this local one,
> while it is 'visible' at this point?


HExecuteSQLQuery did return True, and dsStanden is inside an object, so it shouldn't be conflicting.

What I did do to solve this is pull this query apart into two queries, because it needed 2 connections. With 2 connections, at one time I got a warning that it took 18953 ms to get 1 single record from the database. Now that I've pulled them apart, I'm not sure how quick the select statement is, but it's less that 500ms for sure.

Thank @ArieM and @DarrenF for thinking with me! smiling smiley
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: