VS:DBDocGetDB

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Returns a string representing a ';' delimited list of the databases currently connected to the document.

FUNCTION DBDocGetDB(
VAR outDatabases :DYNARRAY[] of CHAR) : BOOLEAN;
def vs.DBDocGetDB():
    return (BOOLEAN, outDatabases)

Parameters

outDatabases DYNARRAY[] of CHAR

Remarks

_c_ 2010.09.27: Some observations:

  • no database connections in the document: returns FALSE
  • one database connected to the document: the string won't end with colon ";".
  • more databases connected: colon-separated string of database names.

Example

VectorScript

PROCEDURE ODBCtest;
    VAR
        outDatabases : DYNARRAY [] OF CHAR;
BEGIN
    outDatabases := '';	
    IF DBDocGetDB(outDatabases) THEN BEGIN
        AlrtDialog(outDatabases); { colon-separated list of databases, if more than one }
        { .... }
    END;
END;
Run(ODBCtest);

Python

def ODBCtest():
	outDatabases = ''	
	hasDB,  outDatabases= vs.DBDocGetDB()
	if hasDB:
		vs.AlrtDialog(outDatabases); #{ colon-separated list of databases, if more than one }
ODBCtest()

Version

Availability: from Vectorworks 2011