I really would not put lots of OScript into your HMTL pages, I assume that this is the WebLingo layer you are talking about.
You should not need to create your own CONNECT object as one should be available already, so something like the following may work better :
Code:
RecArray vRes = CAPI.EXEC( prgCtx.fDBConnect.fConnection,"select * from DTreeAncestors")
Where
is the Program Context passed into your page, possibly in one of the other objects if not directly as prgCtx.
Also, avoid Dynamics, where possible, as they can be BAD as you don't know what type your variable is, it could be an integer, a RecArray, Assoc etc and certain methods react differently dependant on the datatype of the parameters used, see the OSCRIPT LANGUAGE REFERENCE -> OPERATORS section of the Builder online help for some examples.
I am also not sure why you are running this in your WebLingo, when your original question refered to a WebNode command creation ? is this HTML the output of the WebNodeCmd ? if so then I would recommend doing all the processing in the WebNodeAction and then just passing the results back up as per the module tutorial that comes with the Builder.
Your actual error refs to Livelink not being able to get a valid connection object using the database config etc you have provided, if you use the above method then you should not need to create your own connection and thus avoid this, although with some help it can be debugged to identify the problem(s) in the code.
If you do need to create a new DB connection have a look at
Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006