GetLayerDB()

Summary

Gets the name of the location where a layer is stored.

Syntax

db_name = GetLayerDB(string layer_name)

Argument Contents
layer_name The name of the layer whose source file is determined

Returns

A string containing one of the following:

Layer Type Contents
Geographic file The name of the principal file in the dataset where information for the layer is stored, e.g., the .DBD for a standard geographic file
Image file The name of the principal image file, e.g., the .SID file for a MrSid image
ODBC layer The name of the data source
Oracle layer The name of the service

Notes

  • Most geographic files, and some image files, consist of more than one file on disk. In this case, the string returned will contain the name of the principal file.

Example

lyr = GetLayer()
db = GetLayerDB(lyr)
CopyDatabase(db, "backup")

Error Codes

Error Type Meaning
NotFound The specified layer does not exist

See Also

Function Summary
GetLayer() Gets the name of the current layer, if any
GetLayerType() Gets the type of a layer