So doing some more routing around on the lists I saw this advice<br><br>&gt; FWIW you<br>&gt; might want to call the query or execute methods directly on the DA<br>&gt; connection object if they are supported.<br><br>Therefore&nbsp;my&nbsp;db&nbsp;connection&nbsp;object&nbsp;is
<br> <br>ado_db_connection. Modifying my code to the below and calling the query&nbsp;method&nbsp;of&nbsp;the&nbsp;adapter now gives me an &#39;insufficient priviledges&#39; in my Plone site...Nearly there I feel. Strange as I am logged in as the uberuser...
<br><br> &lt;ul&gt;<br>&lt;li tal:define=&quot;query here/testquery&quot; tal:repeat=&quot;result python:context.ado_db_connection().query(id=&#39;IT&#39;)&quot;&gt;<br>&lt;span tal:replace=&quot;repeat/result/firsname&quot;&gt;firstname goes here&lt;/span&gt;
<br> &lt;/li&gt;<br>&lt;/ul&gt;<br><br><br><div><span class="gmail_quote">On 11/2/07, <b class="gmail_sendername">michael nt milne</b> &lt;<a href="mailto:michael.milne@gmail.com">michael.milne@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
ps for completeness<br><br>here is the testquery ZSQL which works fine when tested in the ZMI and manually inputting the id variable.<br><br>select * from tblEmployees where department = (&lt;dtml-sqlvar id type=&quot;string&quot;&gt;) order by &#39;location&#39; 
<br><br>I have &#39;id&#39; in the argument field<br><br>Thanks<div><span class="e" id="q_115ffa398522500b_1"><br><br><div><span class="gmail_quote">On 11/2/07, <b class="gmail_sendername">michael nt milne</b> &lt;<a href="mailto:michael.milne@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
michael.milne@gmail.com </a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
 Hi Josef<br><br><br><br>&lt;ul&gt;<span><br>&lt;li tal:define=&quot;query here/testquery&quot; tal:repeat=&quot;result python:query(id=&#39;IT&#39;)&quot;&gt;<br></span>&lt;span tal:replace=&quot;repeat/result&quot;&gt;firstname goes here&lt;/span&gt;  
<br> &lt;/li&gt;<br>&lt;/ul&gt;<br><br>gives the same<span><br><br>&gt; AttributeError: Results instance has no __call__ method<br><br></span>As does<span><br><br>&lt;span tal:replace=&quot;repeat/result/firstname&quot;&gt;First Name&lt;/span&gt;  
<br><br></span>As does<br><br>&lt;span tal:replace=&quot;result/firstname&quot;&gt;First Name&lt;/span&gt;<br><br>!<br><br>Thanks for your help. Not easy this ZPT!, even when you have read the documentation :-)<div><span>
<br><br><div><span class="gmail_quote"> On 11/2/07, <b class="gmail_sendername">Josef Meile</b> &lt;<a href="mailto:jmeile@hotmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">jmeile@hotmail.com 
</a>&gt; wrote:</span><blockquote class="gmail_quote" style="margin-top: 0; margin-right: 0; margin-bottom: 0; margin-left: 0; margin-left: 0.80ex; border-left-color: #cccccc; border-left-width: 1px; border-left-style: solid; padding-left: 1ex">
  Hi Michael<br><br>michael nt milne schrieb:<br>&gt; yeah I have modified to this<br>&gt;<br>&gt; &lt;li tal:define = &quot;query here/testquery&quot;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tal:repeat=&quot;result python:query(id=&#39;IT&#39;)&quot;&gt;  
<br>&gt; &lt;span tal:replace=&quot;python:repeat[&#39;result&#39;].firstname&quot;&gt;First<br>&gt; Name&lt;/span&gt;<br>&gt;&nbsp;&nbsp; &lt;/li&gt;<br>&gt;<br>&gt; but get this as a result. Thanks for the reply.<br>&gt;<br>&gt; Module   
Products.PTProfiler.ProfilerPatch, line 32, in __patched_call__<br>&gt; Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__<br>&gt; - __traceback_info__: query(id=&#39;IT&#39;)<br>&gt; Module Python expression &quot;query(id=&#39;IT&#39;)&quot;, line 1, in &lt;expression&gt;  
<br>&gt; AttributeError: Results instance has no __call__ method<br>I suspect that result isn&#39;t a dictionary. Why don&#39;t you try to print<br>result instead and see its type? Try this:<br><br>&lt;span tal:replace=&quot;repeat/result&quot;&gt;&lt;/span&gt;  
<br><br>You could also try the other sintax for your zpt:<br>&lt;span tal:replace=&quot;repeat/result/firstname&quot;&gt;First Name&lt;/span&gt;<br><br>Regards<br>Josef<br>_______________________________________________<br>
  Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Zope@zope.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
 http://mail.zope.org/mailman/listinfo/zope</a><br>**&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp;&nbsp;**<br>(Related lists - <br><a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
 http://mail.zope.org/mailman/listinfo/zope-announce</a><br><a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://mail.zope.org/mailman/listinfo/zope-dev  
</a> )<br></blockquote></div><br><br clear="all"><br></span></div>-- <br><span>michael  </span></blockquote></div><br><br clear="all"><br></span></div>-- <br><span class="sg">michael  </span></blockquote></div><br><br clear="all">
<br>-- <br>michael