All Cadcorp SIS API Methods

CreateDbOverlay Method

Description

Creates an overlay which stores editable Blobs in a database.

Syntax

Visual Basic
Public Function CreateDbOverlay( _
   ByVal pos As Integer, _
   ByVal dialect As Integer, _
   ByVal bTransact As Integer, _
   ByVal connect As String, _
   ByVal tableItem As String, _
   ByVal prj As String, _
   ByVal fmt As Integer, _
   ByVal span As Double _
) As Integer

Parameters

pos
The position in the overlays list at which to insert the overlay. If this argument specifies a position in the existing overlays then the new overlay will not replace the existing overlay at the given position but will shuffle any other overlays down the list.
 
dialect
The dialect to use. This argument is currently ignored, but may be used in future.
 
bTransact
True  Use short transactions for updating linked Items (e.g. topology).
False    Do not use transactions.
 
connect
The connect argument enables SIS to connect to the database containing the data to be mapped. The methods you can use to connect to a database are:
  • DAO (Microsoft Data Access Objects) Note: DAO is not available in 64-bit SIS.
  • ODBC (Open Database Connectivity)
  • Oracle (direct driver)
  • ADO (Microsoft ActiveX Data Objects)

Using DAO the connect should be DAO, followed by a semi-colon, followed by the pathname of the database.
Using ODBC the connect should be ODBC, followed by a semi-colon, followed by a combination of the following components:

DSN=DataSourceName
DATABASE=DatabasePathName
UID=UserName
PWD=Password
LOGINTIMEOUT=seconds


Components should be separated by semi-colons.

  • If the DSN exists a connection will be established. The user name and password components are only necessary if the database to which the DSN refers requires them. If they are not required, you can omit these components altogether, or provide an empty string.
  • If the DSN does not exist you can create one "on-the-fly" by providing full connection details:
    ODBC;DSN=Anything;DATABASE=C:\test.mdb;UID=MyName;PWD=topsecret

If insufficient information is provided then the standard Windows ODBC dialog will be displayed for the user to enter the required information.

Using Oracle the connect should be Oracle and the following components:

Server=HostString
User=UserName
Password=Password

TIP: Components should be separated by semi-colons. Using ADO the connect should be ADO followed by a semi-colon followed by the ADO Connection string. For details on creating ADO connection strings refer to your programming language's documentation.

 
tableItem
The name of the table containing Item information, i.e. Blob, spatial reference, etc. Many different tables may be used for different datasets within a single database.
 
prj
The named coordinate reference system of the stored Item Blobs.
  • OGC URNs (eg 'urn:ogc:def:crs:OGC:1.3:CRS84')
  • EPSG URNs (eg 'urn:ogc:def:crs:EPSG::27700')
  • EPSG code strings (eg 'EPSG:27700')
  • EPSG URLs (eg 'http://www.example.com/epsg#27700' or 'http://www.example.com/epsg.xml#27700')
  • EPSG codes as a simple string (eg '27700')
If blank, this will default to the current 'axes' CRS.
 
fmt

The format of the Item Blob.

SIS_BLOB_OGIS_WKT2 = OGC Well-Known-Text format
SIS_BLOB_OGIS_GML3 = OGC Geographic Markup Language
SIS_BLOB_GEOJSON6 = Geographic Objects for JSON format
 
span
The span used in the spatial reference (see GetSpatialReference).

Remarks

Available: GEO D OD OM SISpy

Groups:

Example

sis.CreateDbOverlay(1, 0, True, "", "BlobTable", "*APrjNatGrid", _SIS_BLOB_SIS, 2000000)

Creates a DbOverlay at position 1 in the current list of overlays, which uses short transactions and prompts for connection strings, storing items in a table called BlobTable using "*APrjNatGrid coordinate reference system in a 2 000 000m span.