Python Connector for xBase

Connection parameters - Python Connector for xBase

Connection parameters

The following table describes xBase connection parameters you can use in the connect() module method.

Parameter Description

Database

The path to the table files

DBFFormat

The database format. The value of this parameter is also used when creating new tables and working with indexes. The possible values are:

  • Auto
  • dBaseIII
  • dBaseIV
  • dBaseV
  • dBaseVII
  • FoxPro2
  • VisualFoxPro
  • HiPerSix
  • Codebase
  • Clipper

The default value is Auto, meaning that the format is detected by the DBF file header. If any other value is selected, the format in the DBF file header will be ignored. The selected format is applied for all tables in the database directory.

IndexOnReading

The indexing mechanism that is used to fetch data. The possible values are:

  • Native – (Default) A standard DBF index (if exists)
  • Local – The connector's internal data indexing mechanism that is way more efficient than native DBF indexes, especially for executing complex queries against many tables.

CodePage

The code page. The possible values are:


Default, UnitedStatesOEM, GreekDOS, WesternEuropeanDOS, TurkishDOS, CentralEuropeanDOS, PortugueseDOS, IcelandicDOS, FrenchCanadianDOS, NordicDOS, CyrillicDOS, Thai, Japanese, ChineseSimplified, ChineseTraditional, Korean, CentralEuropeanANSI, CyrillicANSI, WesternEuropeanANSI, GreekANSI, TurkishANSI, HebrewANSI, ArabicANSI, and BalticANSI.


The default value is Default, meaning that the code page is detected by the DBF file header. If no code page is specified in the file header, the system code page will be used.

ConnectMode

The access mode for DBF table files. The possible values are:
  • Shared – (Default) Multiple applications can concurrently read/write to the same table file. The active application holds a read/write lock on the file but releases the lock once it has finished reading or writing the data.
  • Exclusive – Only one application can access the table file at a time. The active application holds a read/write lock on the file to prevent other applications from reading or writing to it.
  • Unsafe – Multiple applications can concurrently read and write to the table file. Use this mode with caution because it allows multiple applications to modify the file simultaneously. Since DBF databases don't support transactions, an attempt to change the same file simultaneously by multiple applications can cause data corruption in the file.

IgnoreBrokenTables

If set to True, corrupted tables in the database directory will be ignored when establishing a connection, and an exception won't be raised. The default value is False.

IgnoreMetadataErrors

If set to True, metadata errors such as an unknown column data type or incorrect column size will be ignored when opening a DBF table, and an exception won't be raised. The default value is False.

IgnoreDataErrors

If set to True, incorrect column data will be ignored when opening a DBF table, and an exception won't be raised. The default value is False.

IgnoreIndexErrors

If set to True, errors in database indexes will be ignored when opening a DBF table, and an exception won't be raised. The default value is False.

PoolId

The ID of a connection pool that will be used for a particular connection

DisablePooling

Disables connection pooling for a particular connection.

The possible values are True and False. The default value is False.

© 2022-2024 Devart. All Rights Reserved. Request Support Python Connectors Forum Provide Feedback