Server Refresh statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Resynchronizes a linked or live table with the remote database data. This command can only be run when no edits are pending against the table. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Server Refresh TableName Rec RecNumber

TableName is the name of an open MapInfo linked table.

RecNumber record number for a single row in a relational database (RDB) table.

Description

If the connection to the database is currently open then the refresh simply occurs. If the connection is not currently open, then the connection will be made. If there is any information needed, such as a password, the user will be prompted for it.

Refreshing the table involves:

  1. If the table contains records, delete all the records and objects from the live or linked table by erasing the files and recreating the table, not by using the MapBasic Delete statement.
  2. If a connection handle is stored with the TABLE structure, use it. Otherwise, reconnect using the connection string stored in the live or linked table metadata.
  3. Convert SQL query stored in metadata to RDBMS-specific query.
  4. Execute SQL query on RDBMS.
  5. Fetch rows from the RDBMS cursor, filling the table. Put up a MapInfo Pro progress bar during this operation.
  6. Close RDBMS cursor.

Rec RecNumber refreshes a single row in a relational database (RDB) table. The table cannot have pending edits in the row that will be refreshed. The feature applies to both linked and live tables.

Example

Server Refresh "City_1k"

See Also:

Commit Table statement, Server Link Table statement, Unlink statement