All Cadcorp SIS API Methods

DefineRecordset Method


Defines a named recordset, for use with databases, replacing any existing recordset with the same name.


Visual Basic
Public Function DefineRecordset( _
   ByVal rs As String, _
   ByVal connect As String, _
   ByVal tables As String, _
   ByVal columns As String, _
   ByVal aliases As String, _
   ByVal sqlwhere As String _
) As String


The named recordset to create or replace.

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)
  • OracleCI (Oracle Instant Client)
  • ADO (Microsoft ActiveX Data Objects)
  • CSV (Comma Separated Values)

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:


  • 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:


  • 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:


  • Components should be separated by semi-colons.
  • Using OracleCI (Oracle Instant Client) the connect should be OracleCI, followed by a semi-colon, followed by the connection string:

  • For non-encrypted passwords Plaintext must be True. For encrypted passwords the Plaintext parameter must be omitted.
  • 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.

Using the CSV connection to load from a View Points overlay

To define a recordset from a CSV file (e.g. for subsequently creating a View Points overlay using “CreateDbPointOverlay”), the database connection string must be appended with a JSON string.

The following is a sample code in a C# environment:

string strConn = "CSV;<json configuration>";
      "FileName": "G:\\Data\\incidents.csv",
      "CodePage" : 1252,
      "FileFormat" : "delimited",
      "FirstRowContainsFieldNames" :  true,
      "FieldDelimiter" : ",",
      "SkipLinesMatching" : "1",
      "HeaderLines" : 3,
      "KeepFirstLine" : true,
      "FooterLines" : 0,
      "DateOrder" : "DMY",
      "Columns" : [
                    "Name" : "newColumnName",
                     "Type" : "double"
                    "Name" : "newColumnNameB",
                     "Type" : "double"


SIS.DefineRecordset("rs", strConn, "incidents,incidents", "originx,originy", "originx#,originy#", "" );

Note: All parameters in this code are optional, except for FileName and Columns. Missing fields will be guessed by the CSV database connection.

The parameters that may be used for the Skip Lines options in a CSV file are; SkipLinesMatching, HeaderLines, KeepFirstLine, FooterLines.

A comma-delimited list of tables which contain the columns referred to in the columns argument.
A comma-delimited list of columns which contain the data which will be available when the named recordset is used.
A comma-delimited list of aliases for the columns referred to in the columns argument.

An optional SQL WHERE expression, e.g. "(Table.StatusColumn = 'Pending' Or Table.StatusColumn = 'Agreed')". This expression should be wholly self-contained, using brackets if they are supported in the database, because under some circumstances, e.g. if a Spatial Reference is being used, SIS automatically generates a WHERE clause, with this expression appended using "And".

Note: The tables, columns and aliases arguments must all contain the same number of comma-delimited entries. The table/column/alias entry at each position in the each comma-delimited list must be consistent with the other two lists. When calling CreateDbBlobOverlay or CreateDbPointOverlay the nf arguments refer to positions within the table/column/alias comma-delimited lists, starting at 0.

Return Type

The full database connection string used.


Available: GEO D OD OM SISpy



sis.DefineRecordset ("Depths", "", "Soundings,Soundings", "Northing,Easting", "X#,Y#", "Depth < 0")

Note: In the comma-delimited list in the example there must not be any spaces, i.e. "Soundings,Soundings" is correct but "Soundings, Soundings" (with a space) would not be correct.