on 06-13-2006 11:40 AM
Hi all,
I was wondering if there is a way to retrieve programatically the object type from the table name.
For instance I want to get the value oOrders (or 17) from the string ORDR.
This has to work in any cases.
Cheers,
Hi Cyril,
Afaik there is no way to retrieve the objecttype from the tablename.
You have to write a function yourself to get the objecttype from the tablename.
Regards
Ad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Add,
This is the best I could achieve, though this will only work if there is at least one record in the table...
Public Shared Function GetObjectType(ByRef Obj_Recordset As Recordset, ByVal TableName As String) As BoObjectTypes
Dim tRet As BoObjectTypes
Dim sQuery As String = _
"IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME = '" & TableName & "' AND COLUMN_NAME = 'ObjType') " & _
"SELECT TOP 1 [ObjType] FROM [" & TableName & "]"
Obj_Recordset.DoQuery(sQuery)
If Obj_Recordset.RecordCount = 1 Then
tRet = CType(Obj_Recordset.Fields.Item(0).Value, BoObjectTypes)
End If
Return tRet
End Function
Cheers
Message was edited by: Cyril Morel
No, this is not available. If you need this you will need to implement it by yourself, getting the data by hand from the SDK DI documentation.
A word of caution: the relationship object type - table name can change during different releases.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
9 | |
5 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.