mdb-queries is a utility program distributed with MDB Tools.
Without query, it lists the names of all saved queries in the database.
With query, it returns the SQL text of the named query or queries.
mdb_queries(
path,
query = NULL,
list = TRUE,
newline = FALSE,
delimiter = " ",
as_text = FALSE,
as_list = TRUE
)Path to .mdb/.accdb file.
Character vector of query names. When NULL (the default),
the function lists available query names instead of fetching SQL.
Logical; when TRUE (the default) and query is NULL,
return the list of query names. Set to FALSE to suppress listing and
return character(0).
Logical; when TRUE and as_text = TRUE, collapse names
with "\n" instead of delimiter.
Character scalar used to collapse query names when
as_text = TRUE. Default " ".
Logical; when TRUE, collapses the query name list into a
single string using delimiter (or "\n" if newline = TRUE).
Logical; defaults to TRUE. When TRUE and query is
supplied, wraps the result in a named mdblist object.
When query is NULL: a character vector of query names (or a
collapsed string when as_text = TRUE). When query is supplied and
as_list = TRUE: a named mdblist of SQL text strings, one per query.
With a single query and as_list = FALSE: a character scalar.
db <- mdbr:::.mdb_example_nwind_path()
if (nzchar(db)) {
mdb_queries(db)
mdb_queries(db, "Orders Qry")
}