Microsoft dBase driver

Microsoft dBase driver (*.dbf) connection string

Microsoft dBase driver allows connection to dBase databases (DBF and DBT files) over ODBC.

  • DBF files store 8-bit characters thus Unicode characters are not supported
  • This driver is preinstalled in modern versions of Windows desktop

Driver

Driver={Microsoft dBase driver (*.dbf)}

CollatingSequence

Collating (sort) order not a code page. Supported values are:

  • ASCII – sort as ASCII text, this is default value
  • International – international sort order (Western Europe)
  • Norwegian-Danish – as is says this is Norwegian-Danish sort order
  • Swedish-Finnish – as it says Swedish-Finnish sort order

DBQ

This mandatory parameter should point to folder containing database files (*.dbf etc).

Dot character DBQ=. means current folder.

Deleted

This optional values specifies should the driver display deleted records. dBase does not physical delete records upon DELETE query just mark them as deleted so deleted records could be read.

  • 0 – hide deleted records
  • 1 – display deleted records as usual ones

DriverId

A number specifying driver type.

  • 21 – dBASE III
  • 277 – dBASE IV
  • 533 – dBASE 5.0, this is default value

ReadOnly

Optional boolean value to specify access type.

  • 0 – read/write access, this is default value
  • 1 – read only access, may be useful as a protection if the connection is not intended to modify data

When trying to make any changes on connection with ReadOnly=1 error will be reported.

Exclusive

This optional boolean value allows to take exclusive access to the database.

  • 0 – non-exclusive access, other programs will be allowed to open the database, this is default value
  • 1 – exclusive access, other programs will not be allowed to open the database

Microsoft dBase driver (*.dbf) examples

Connect to current folder for read-only access:

DBQ=.;ReadOnly=1

Connect to C:\Program\Database with exclusive read-write access:

DBQ=C:\Program\Database;Exclusive=1

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *