Private Function getProgID(pFeatureWorkspace As IFeatureWorkspace, versionName As String)
' Create Query Definition
Dim pCursor As ICursor
Dim pRow As IRow
Dim pQueryDef As IQueryDef
Set pQueryDef = pFeatureWorkspace.CreateQueryDef
' Provide list of tables to join
pQueryDef.Tables = "object_locks ,versions"
' Retrieve the fields from all tables
pQueryDef.SubFields = "object_locks.sde_id,versions.name"
' Set up join
pQueryDef.WhereClause = "object_locks.object_id = versions.version_id and versions.name = '" + versionName + "'"
Set pCursor = pQueryDef.Evaluate
Set pRow = pCursor.NextRow
If Not pRow Is Nothing Then
getProgID = pRow.Value(0)
Else
getProgID = ""
End If
End Function