Hi Noli, <div><br></div><div>you could use this [1] (sorry, it&#39;s in Spanish). It uses the Sqlite3 Python module [2].</div><div><br></div><div>Regards, </div><div><br></div><div>Germán</div><div><br></div><div>----------------------------</div>

<div>[1] <a href="http://geotux.tuxfamily.org/index.php?option=com_myblog&amp;task=view&amp;id=251&amp;Itemid=59">http://geotux.tuxfamily.org/index.php?option=com_myblog&amp;task=view&amp;id=251&amp;Itemid=59</a></div><div>

[2] <a href="http://docs.python.org/library/sqlite3.html">http://docs.python.org/library/sqlite3.html</a><br><br><div class="gmail_quote">On Fri, Sep 10, 2010 at 9:49 AM, Noli Sicad <span dir="ltr">&lt;<a href="mailto:nsicad@gmail.com">nsicad@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
Given, this example from PyQGIS documentation.<br>
<br>
~~~~~~~~<br>
uri = QgsDataSourceURI()<br>
uri.setDatabase(&#39;/home/martin/test-2.3.sqlite&#39;)<br>
uri.setDataSource(&#39;&#39;,&#39;Towns&#39;, &#39;Geometry&#39;)<br>
<br>
layer = QgsVectorLayer(uri.uri(), &#39;Towns&#39;, &#39;spatialite&#39;)<br>
~~~~~~~~~<br>
<br>
How do you do a runtime for the above. I want to select the table /<br>
layer to load. How you figure out the  uri.setDataSource(&#39;&#39;,&#39; &#39;,<br>
&#39;Geometry&#39;) and  QgsVectorLayer(uri.uri(), &#39; &#39;, &#39;Spatialite&#39;)?<br>
<br>
~~~~~~~~<br>
    file = QFileDialog.getOpenFileName(self,&quot;Open Spatialite&quot;, &quot;.&quot;,<br>
&quot;Spatialite (*.sqlite)&quot;)<br>
    fileInfo = QFileInfo(file)<br>
<br>
    uri = QgsDataSourceURI()<br>
    uri.setDatabase(file)<br>
    uri.setDataSource(&#39;&#39;,&#39; &#39;, &#39;Geometry&#39;)<br>
<br>
    # Add the layer<br>
    layer = QgsVectorLayer(uri.uri(), &#39; &#39;, &#39;Spatialite&#39;)<br>
<br>
~~~~~~~~~<br>
<br>
Noli<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-----------<br>  |\__  <br>(:&gt;__)(<br>  |/    <br><br>Soluciones Geoinformáticas Libres                            <br><a href="http://geotux.tuxfamily.org/">http://geotux.tuxfamily.org/</a><br>


</div>