Name: revDatabaseID

Synonyms: revdb_cursorconnection

Type: function

Syntax: revDatabaseID(<recordSetID>)

Summary:
<return|Returns> the database ID of the <database> that opened a 
<record set>.

Associations: database library

Introduced: 1.1

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Security: disk, network

Example:
revDatabaseID(weeklyOccupancy)

Example:
if revDatabaseID(currentCursor) is not field "DB ID" then
  next repeat
end if

Parameters:
recordSetID:
The number returned by the revQueryDatabase function when the record set
was created.

Returns:
The <revDatabaseID> <function> returns a positive <integer>.

Description:
Use the <revDatabaseID> <function> to find out which <database> a
<record set> belongs to.

The returned value is the same as the value returned by the
<revOpenDatabase> <function> when the <database> was first opened.

You can use the returned value to close a database after your stack is
finished with it.

>*Important:*  The <revDatabaseID> <function> is part of the 
> <Database library>. To ensure that the <function> works in a 
> <standalone application>, you must include this 
> <LiveCode custom library|custom library> when you create your 
> <standalone application|standalone>. In the Inclusions pane of the 
> <Standalone Application Settings> window, make sure both the 
> "Database" library checkbox and those of the database drivers you are 
> using are checked.

Changes:
The revDatabaseID synonym was added in version 2.0.

References: revCloseDatabase (command), function (control structure),
revOpenDatabase (function), Standalone Application Settings (glossary),
database (glossary), standalone application (glossary),
record set (glossary), return (glossary),
LiveCode custom library (glossary), integer (keyword),
Database library (library)

Tags: database

