GetObjectByName Method (SQL-DMO)

The GetObjectByName method returns a DBObject object referencing the specified Microsoft® SQL Server™ database object.

Applies To

Database Object

Syntax

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.

Returns

A DBObject object.

Prototype (C/C++)

HRESULT GetObjectByName(
SQLDMO_LPCSTR szName,
LPSQLDMODBOBJECT* ppDBObject,
SQLDMO_OBJECT_TYPE lType = SQLDMOObj_AllDatabaseObjects,
SQLDMO_LPCSTR szOwner CPPDEFAULT(= NULL));

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.