Classic ASP: Error 500 on repeat

I’m getting an error 500 when I repeat my query. The data works fine until I add the re-query. I’m not that great at using the troubleshooting tools because I can’t find where the “error” is…

I’m following the instructions here https://docs.wappler.io/t/nested-repeat-regions/5165

Something is happening in the 2nd query as their is no output, I ca see the data in the first query but nit the second. The linked fields are both integers

Hello @rokit
The following article explains how to check the exact error:

thanks for the quick response, I an debugging at the data connection level as I noticed any page I created didn’t work properly. must I create a page to see the error?

I am not sure i understand your last comment.
The article i sent you explains how to debug server connect errors. Have you followed it?

I am using this debug image

I’ll try maiking a page and debugging

You should not use this debug.
Do what is explained in the tutorial i.e. enable ONLY the debug option explained there, then you can run your server action in the browser and see the result …

Oh OK, then why is it there?

Anyway I made a page but (with debug mode on) it only displays this
image

It’s there for other purposes.

If you see the 500 - internal server error message, and not the exact error, then you will need to enable detailed error reporting on your server.

I get this
image

Ok so can you post a few screenshots of how is your server action setup, and how do you filter the nested query?
It seems somewhere a the value you pass is a wrong type. For example, somewhere you need a string, and you use a number instead, or vice versa.

image
Manager group has no conditions


Employees are linked by manager id
I’ve managed to get it to appear one or twice and I can get manager group info but not employee detail. I suspect this is the issue but both are int fields and appear as number fields in the query
image

Does the error 500 appear only after you nest and filter the second query, inside the repeat?

Yes I believe so

Can you try removing the repeater and see if your first query returns values?

Then if it works, try adding the repeater with the second query without filtering it. Is it working?

Yea it works (slow because of the amount of data) and when I add the condition it stops working altogether

I’m really struggling trying to figure out why I can’t build a nested region between this manager and employee table… Am I using the wrong tool?

I have a table with managers and a table with employees. Both have a numeric field for manager. What is the best way o build a list with manager as a heading then list the employees under them?

@rokit, if I understand correctly, you have two tables, one for managers and one for employees.

In the managers table you have a field ManagerID. In the employees table you have a field ID and a field Manager, and all are int datatypes.

You can use the query builder to pull a combined query using a JOIN statement. To do so, add a query and then add the MgrGrp table, then add the fields from the MgrGrp table that you want displayed in your results. If you do not want any fields to show from the MgrGrp table, then just select ManagerID.

Then you would add (by clicking the plus sign in the upper left hand corner) the EmplDetails table. In the pop-up that displays the JOIN condition, select ManagerID on the left side and Manager on the right side.

This will add the EmplDetails table and link it to the MgrGrp table. Add the fields from the EmplDetails table that you want to show in the results.

Click on the conditions tab and add your condition for what Manager group you want to show. You would do this by choosing ManagerID is equal to either a specific number or if you want to use a variable, by using the appropriate variable (GET or POST).

Once you have the server side displaying the query results, we can move on to the App Structure side.

To see if the query results, click on the save button to save your work and then click on the Open in Browser icon on the server actions panel.

Thanks for taking the time to respond in detail. It appears my problem arises when I connect the data in conditions. Despite the fields being of the same type I get and error 500 when I build the query exactly as you described. I think I need to create or use some other tables to see if I have a data issue that is creating my problem.

@rokit
what server model are you using?

classic asp