Search notes:

DAO Object Model: Database

A Database object seems to encapsulate the tables, forms, queries etc. of an Access (.accdb) file.
The database object for the currently open .accdb is returned by application.currentDb().
The Database object belongs to DAO rather than Access.

Methods and properties

close()
collatingOrder
connect
connection
containers
createProperty()
createQueryDef()
createRelation()
createTableDef()
designMasterID
execute()
makeReplica()
name
newPassword()
openRecordset()
populatePartial()
properties
queryDefs
queryTimeout
recordsAffected
recordsets
relations
replicaID
synchronize()
tableDefs
transactions
updatable
version

createQueryDef

createQueryDef creates a persistent or temporary queryDef object.

name

The name property returns the path of the accdb file.
option explicit

sub main()

    dim db as database
    set db = currentDb()

    debug.print(db.name)

end sub
Github repository about-MS-Office-object-model, path: /Access/Database/name.bas

openRecordset

Contrary to execute, openRecordset allows to execute an arbitrary SQL statement that returns a Recordset.

properties

Gone here.

See also

The DBEngine object
Access Object Model

Index