Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere Python Database support


Introduction to sqlanydb

The sqlanydb interface provides access to SQL Anywhere databases from scripts written in Python. The sqlanydb module implements, with extensions, the Python Database API specification v2.0 written by Marc-André Lemburg. Once you have installed the sqlanydb module, you can access and change the information in SQL Anywhere databases from Python.

For information about the Python Database API specification v2.0, visit [external link] Python Database API specification v2.0.

The sqlanydb module is thread-safe when using Python with threads.


The sqlanydb module requires the following components.

  • Python 2.4 or newer (2.5 or newer is recommended).

  • The ctypes module is required. To test if the ctypes module is present, open a command prompt window and run Python.

    At the Python prompt, enter the following statement.

    import ctypes

    If you see an error message, then ctypes is not present. The following is an example.

    >>> import ctypes
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    ImportError: No module named ctypes

    If ctypes is not included in your Python installation, install it. Installs can be found in the files section at [external link], or can be automatically downloaded and installed with Peak EasyInstall. To download Peak EasyInstall, visit [external link]

The following sections provide assistance with installing Python and the sqlanydb module.