SqlTabName$

Returns the name of a table based on its number.

Syntax

SqlTabName$ ( sqlconn%, tabnum% )

where

sqlconn% ( )
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.
tabnum%
Is the number of a table. Table numbers start with 1. Use SqlTabCount% to find out the total number of tables involved in a particular statement.

Returns

A string containing the name of a specified table. This string is empty if the table number is out of range or if the specified table is a SQL Server work table. For a description of work tables, see SqlTabCount%.

Remarks

SqlTabName$ is a DB-Library for Visual Basic browse-mode function. For a detailed discussion of browse mode, see DB-Library for Visual Basic Programming.

A SELECT statement can generate a set of result rows whose columns are derived from several database tables. The database tables are specified by the FROM clause. SqlTabName$ provides a way for an application to determine the name of each table involved in an ad hoc query. When the query has been hard-coded into the application, SqlTabName$ is unnecessary.

You can call SqlTabName$ any time after you call SqlResults%.

See Also

SqlColBrowse%, SqlColSource$, SqlQual$, SqlTabBrowse%, SqlTabCount%, SqlTabSource$, SqlTsNewLen%, SqlTsNewVal$, SqlTsPut%