GetIDObject Method
Class: _DBC
This method return object ID for any object in DBC.
=
Object.GetIDObject
Parameter
lcAlias
DBC Alias
Type Character
Direction Input
Alias of opened DBC as table.
lcType
Object Type
Type Character
Direction Input
List of types
ValueDescription
_DBC_DataBaseDatabase
_DBC_TableTable
_DBC_FieldField
_DBC_IndexIndex
_DBC_RelationRelation
_DBC_ConnectionConnection
_DBC_ViewView
lcObjName
Object Name
Type Character
Direction Input
Object name. Name of table, view, connection. Database is object name for database. Object name of fields, indexes and relation is table/view name and dot and name of fields, indexes and relation (table.field/table.index/table.relation).
Return value Integer
If the method succeeds, the return value is Object ID.

If the method fails, the return value is _DBC_ObjectNotFound .
Example
#INCLUDE "dbc.h"
SET PROCEDURE TO dbc.prg ADDITIVE
LOCAL lcAlias,liIDT,loDBC
loDBC=CREATEOBJECT("_DBC")
lcAlias=SYS(2015)
=loDBC.OpenTable(HOME(2)+"\Tastrade\Data\tastrade.dbc",lcAlias,"")
liIDT=loDBC.GetIDObject(lcAlias,_DBC_Table,"products")
?liIDT
loDBC.CloseTable(lcAlias)
RELEASE loDBC
RELEASE PROCEDURE dbc.prg


See also
Expand/Collapse source code of procedure GetIDObject Source Code
      LPARAMETERS lcAlias,lcType,lcObjName
      * lcAlias   - Alias of opened DBC
      * lcType    - Object Type
      * lcObjName - Object Name


      SELE (lcAlias) && Skip to DBC 
      IF INLIST(lcType,_DBC_Field,_DBC_Index,_DBC_Relation)
         LOCAL lcParent,lii,lcObj
         lii=AT(".",lcObjName) && Find dot
         lcParent=PADR(UPPER(LEFT(lcObjName,lii-1)),128)
         lcObj=PADR(UPPER(SUBST(lcObjName,lii+1)),128)
         * Find Parent
         LOCATE FOR INLIST(ObjectType,_DBC_Table,_DBC_View) AND;
                    UPPER(ObjectName)==lcParent  AND ! DELE()
         IF FOUND() && If found
            lii=ObjectID
            * Find object
            LOCATE FOR ParentID=lii AND ObjectType==lcType AND ;
                       UPPER(ObjectName)==lcObj AND ! DELE()
         ENDIF
      ELSE
         LOCATE FOR ObjectType==lcType AND UPPER(ObjectName)==PADR(UPPER(lcObjName),128);
                AND ! DELE()
      ENDIF
      RETURN IIF(FOUND(),ObjectID,_DBC_ObjectNotFound)