Error on database connection in menu application

I made a menu where I retrieve data from $_Session and then try to locate in the database. I have set the connection in application -> settings. After generation I get an error:

Fatal error: Call to a member function Execute() on a non-object in C:\Program Files (x86)\NetMake\v7\wwwroot\scriptcase\app\DOHMWWW\main\main.php on line 281

If I look at the code then I get:


 272|
 273|
 274| $check_sql = "SELECT naam from bedrijf where herkomst='".$this->sc_temp_glob_herkomst."'";
 275|  
 276|       $nm_select = $check_sql; 
 277|       $_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select; 
 278|       $_SESSION['scriptcase']['sc_sql_ult_conexao'] = ''; 
 279|       $this->rs = array();
 280|       if ($rx = $this->Db->Execute($nm_select)) 
 281|       { 
 282|           $y = 0; 
 283|           $nm_count = $rx->FieldCount();
 284|           while (!$rx->EOF)
 285|           { 
 286|     

To me it looks like the connection is not used although it has been defined (see screenshot)

However, I added the code in the onapplicationinit. If I do so in the onload it does work. Now I know that the connection might not be available in onapplicationinit, but the codesnippets on the right if you open the event is showing a green dot on the select…

demo.JPG

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann