DBDATASOURCES Function

Returns a list of data sources as a dbcursor. DBDATASOURCES is a global function.

Category: Database

Syntax

DBDATASOURCES(< >)

Without Arguments

Returns a list of data sources as a dbcursor. The data source includes:
NAME
a string containing the name of the data source.
DESCRIPTION
a string containing the driver (shown in the ODBC Administrator and DataFlux Connection Administrator).
Type
an integer containing the subsystem type of the connection [1 = ODBC; 2 = DataFlux TKTS].
HAS_CREDENTIALS
a Boolean representing if save connection exists.
USER_DESCRIPTION
a string containing the user-defined description of the data source (defined in the ODBC Administrator and DataFlux Connection Administrator).

Example

// list all data sources
dbconnection db_conn
db_conn=dbconnect("dsn=dsn name")
dbcursor db_conn.db_curs
db_curs = dbdatasources()
ncols = db_curs.columns()
 
while db_curs.next()
begin
   for i_col=0 to ncols-1
   begin
      colname = db_curs.columnname(i_col)
      coltype = db_curs.columntype(i_col)
      collength = db_curs.columnlength(i_col)
      colvalue = db_curs.valuestring(i_col)
      pushrow()
   end
end

db_curs.release()
db_conn.release()