The GetObjectByName method returns a DBObject object referencing the specified Microsoft® SQL Server™ database object.
object.GetObjectByName( Name , [ ObjectType ] , [ Owner ] ) as DBObject
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list. |
Name | Specifies a SQL Server database object by name. |
ObjectType | Optional. Long integer specifying object type. When specified, it directs method searching, optimizing the search. Set ObjectType by using SQLDMO_OBJECT_TYPE. |
Owner | Optional. String identifying an existing database user by name. When specified, it constrains searching to objects owned by the user. |
A DBObject object.
HRESULT GetObjectByName(
SQLDMO_LPCSTR szName,
LPSQLDMODBOBJECT* ppDBObject,
SQLDMO_OBJECT_TYPE lType = SQLDMOObj_AllDatabaseObjects,
SQLDMO_LPCSTR szOwner CPPDEFAULT(= NULL));