isClosed {ODB}R Documentation

Checks if a DBI connection is closed

Description

Checks if a connection inheriting from the DBIConnection class (including 'ODB' connections) is closed.

Usage

  isClosed(connection)

Arguments

connection

An object inheriting from DBIConnection class.

Value

Returns a single logical value, whether SQL queries can be sent to the connection or not.

Author(s)

Sylvain Mareschal

See Also

odb.open, odb.close

dbConnect, dbDisconnect

Examples

  # New empty .odb file
  odbFile <- tempfile(fileext=".odb")
  odb.create(odbFile, overwrite="do")
  ODB <- odb.open(odbFile)
  
  # Is the connection closed ?
  print(isClosed(ODB))
  
  # Save changes in the .odb file
  odb.close(ODB, write=TRUE)
  
  # And now ?
  print(isClosed(ODB))

[Package ODB version 1.2.1 Index]