Knowledge Base Article
KB10418 - How can I open multiple ADO layers? How can I build a new ADO layer in code? I am developing an application using the DK-ActiveX with VB.NET. The only examples I can find for loading ADO layers is using the GIS.Open method and this will not allow more than one ADO layer to be opened at one time. I have tried using SQLParams to replicate the commands in the ttkls file but this gives error messages.
1) The proper way to use the ttkls file:
ll = New XGIS_LayerSQL_ADO
ll.Path = 'lwaters.ttkls'
GIS.Add( ll )
ll = New XGIS_LayerSQL_ADO
ll.Path = 'lwaters2.ttkls'
GIS.Add( ll )
ll = New XGIS_LayerSQL_ADO
ll.Path = 'lwaters3.ttkls'
GIS.Add( ll )
2) The proper way to use SQLParams:
llSQL = New TatukGIS_DK.XGIS_LayerSQL_ADO()
llSQL.SQLParameter("LAYER") = "lwaters"
llSQL.SQLParameter("DIALECT") = "MSJET"
llSQL.SQLParameter("ADO")= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=gistest.mdb"
GIS.Add(llSQL)
(The above is valid only with the DK v. 8 or later versions.)
3) The proper way to build a new ADO layer:
a)
llNew = New TatukGIS_DK.XGIS_LayerSQL_ADO()
llNew.Build("lwaters.ttkls", some_extent, TatukGIS_DK.XGIS_ShapeType.XgisShapeTypeArc)
If you know the desired extent use
Utils = New XGIS_Utils
some_extent = Utils.GisNoWorld ;
b) (Valid in the DK 8)
llSQL = New TatukGIS_DK.XGIS_LayerSQL_ADO()
llSQL.SQLParameter("LAYER") = "lwaters"
llSQL.SQLParameter("DIALECT") = "MSJET"
llSQL.SQLParameter("ADO") = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=gistest.mdb"
llSQL.Build( "", some_extent, TatukGIS_DK.XGIS_ShapeType.XgisShapeTypeArc)
Created: 2003-11-21, Modified: 2005-09-14
|