DB->get_type()
Prev | Chapter 2. The DB Handle | Next

## DB->get_type()

    #include <db.h>

    int
    DB->get_type(DB *db, DBTYPE *type);

The `DB->get_type()` method returns the type of the underlying access method (and file format). The type value is one of DB_BTREE, DB_HASH, DB_RECNO, or DB_QUEUE. This value may be used to determine the type of the database after a return from DB->open() with the type parameter set to DB_UNKNOWN.

The `DB->get_type()` method may not be called before the DB->open() method is called.

The `DB->get_type()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### type

The type parameter references memory into which the type of the underlying access method is copied.

### Errors

The `DB->get_type()` method may fail and return one of the following non-zero errors:

#### EINVAL

If the method was called before DB->open() was called; or if an invalid flag value or parameter was specified.

### Class

DB

### See Also

Database and Related Methods

Prev | Up | Next
DB->get_re_source() | Home | DB->join()