Accessing remote spatial data, Accessing remote tables through a .tab file, Accessing remote tables without a .tab file – Pitney Bowes MapXtreme User Manual

Page 215

Advertising
background image

Chapter 11: Accessing Data from a DBMS

Accessing Remote Spatial Data

MapXtreme v7.1

222

Developer Guide

Accessing Remote Spatial Data

You can access data using MapXtreme with different DBMS servers. The servers include:

Microsoft Access 2007 and Excel 2007

Microsoft Access 2003

Oracle 11G (11.1.0.6.0 and 11.1.0.7.0)

Oracle 10G, 10GR2

Microsoft SQL Server 2012 (with SQL Native Client 11)

Microsoft SQL Server 2008 (with SQL Native Client 10)

MapInfo SpatialWare® 4.9 and 4.9.2 for Microsoft SQL Server 2005

MapInfo SpatialWare® 4.9.2 for Microsoft SQL Server 2008 32- and 64 bit editions

You can add a table from data in a DBMS using the TableInfoServer class in the MapInfo.Data
namespace.

The details for adding spatial data are included in the following sections.

Accessing Remote Tables Through a .TAB File

A MapXtreme application can access DBMS data “live”, or can open a MapInfo Professional linked
table. However, the linked table will be read-only and cannot be refreshed by your application. The
data is actually from the remote database and does not reflect the data in the local linked version.

You can create a .TAB file to provide access to remote data. To generate a .TAB file using MapInfo
Professional, choose File > Open a DBMS table.

The .TAB file is a text file; you can create a .tab file using any text editor. Once you have created the
.tab file, you can access it the way you access any other MapInfo .TAB file programmatically through
the Catalog object or through the Workspace Manager.

Accessing Remote Tables Without a .TAB File

An application does not need a .TAB file to access remote data. The following code sample
illustrates this process.

VB example:

Public Shared Sub MapInfo_Data_TableInfoServer(ByVal connection As _

MIConnection)

' Note: Do not specify any columns. These are determined
' dynamically from the query

Dim ti As TableInfoServer = New TableInfoServer("Provinces")
ti.ConnectString = "SRVR=ontario;UID=mapx;PWD=mapx"
ti.Query = "Select * From Provinces"
ti.Toolkit = ServerToolkit.Oci

Advertising