Phil, I'm not sure about VS Code, but you can do this in studio by creating a new CSP page with the following contents:

<csp:StudioSimpleTemplate name="CustomCommentHead" type="CLS" mode="new">
/// Organization:
/// Version 1.0
/// Author/Co-author:
/// Project: 
/// Date: 
/// Description: 
/// Change Log:
/// Notes:

Then save and compile that file. It doesn't matter where. Then when you click File, New, Custom, you'll see your CustomCommentHead template. If you choose it, you'll get a .cls file with those lines already inserted.

I've used it with Cache 2018, but not as far back as 2016. You'll have to manually add the driver to DBeaver first to try it. To do that, first get a copy of the JDBC driver, which should be in the installation directory for your Cache instance. Look for a folder called dev, then java, then lib, then JDK17 or JDK18 depending on which version of Java is installed on your machine, then there should be a jar file with a name like cache-jdbc-x.y.z.jar. Copy that somewhere easy to get to.

In DBeaver, click on the Database menu, then Driver Manager. Click New. Give the driver a name like Cache 2016 or something you'll recognize. Under driver files, click Add File and choose that .jar file. The class name for the driver should be com.intersys.jdbc.CacheDriver. In the sample URL field put a URL that would connect to your Cache instance, which would look like jdbc:Cache//(server):(port)/(namespace). Click on Test Driver to verify. If it works, click OK.

Now when you go to Database, New Connection, you should see that driver listed as an option.

If you're developing in Studio, open the file that contains that TestAccountSearchWithoutAccount method, then click the "View Other Code" button so you're looking at the INT code. If it says no other code to view, that's fine; you're already where you need to be. There should be a small text field near the top of the window with a drop down arrow on its left end. In that text field, type TestAccountSearchWithoutAccount+6 and press enter. That should take you directly to the line where the error is occurring.

Something on that line is trying to reference an object that doesn't exist. That's what "INVALID OREF" means. Whatever objects are on that line, check how they were created and/or opened and see if there's a chance that the object doesn't exist.

After using your %ExecDirect() method, you should have a %SQL.StatementResult Object. Let's assume you called this object rs (for result set). So you did something like set rs = ##class(%SQL.Statement).%ExecDirect(blahblahblah). From there:

//Get the list of columns
set cols = rs.%GetMetaData().columns
//Loop through the result object
while rs.%Next(){
//Loop through the columns
     for x=1:1:rs.%ResultColumnCount{
     //Get the value of each column
         set colValue = rs.%GetData(x)
         //Get the name of each column
         set colName = cols.GetAt(x).colName
         //TODO: Add whatever you're doing with the name and value here
     }
}

Where you're using document.getElementById() in javascript, you're probably not getting the right element. If you right click on the element and inspect it in your web browser, you'll see that it has an id like zen13 or something similar.

Instead of document.getElementById('loading') try using just zen('loading'), for example:

zen("loading").style.display = "none"