|
-
May 21st, 2002, 05:44 AM
#1
How to find Column Description
Hi Guys,
I have a small problem.I m creating a database in SQL Server.Now because of our naming convention standards me coulnn names are not descriptive in nature.For e.g. 'First Name' will be TSUY65FN.
Now Since it is not possible to remember these name we also store Description of these fields while creating the tables.
Now comes the real problem.I want to access these descriptions through vb.I am using ADO2.5.
Can you help Me?
-
May 21st, 2002, 07:59 AM
#2
You should be able to modify the below to suit your needs ;
Code:
Function GetFieldDescription (ByVal MyTableName As String, ByVal MyFieldName As String)
Dim DB As Database
Dim TD As TableDef
Dim FLD As Field
Set DB = DBEngine.Workspaces(0).Databases(0)
On Error GoTo Err_GetFieldDescription
Set TD = DB.TableDefs(MyTableName)
Set FLD = TD.Fields(MyFieldName)
GetFieldDescription = FLD.Properties("Description")
Bye_GetFieldDescription:
Exit Function
Err_GetFieldDescription:
Beep: MsgBox Error$, 48
GetFieldDescription = Null
Resume Bye_GetFieldDescription
End Function
-
May 21st, 2002, 08:27 AM
#3
vivek_29, as I understand it (I will attempt to find some reference material to back this up soon the "Description" field in the OLEDB provider is marked as optional and to date the SQL server providers do not actually populate this field though it exists.
TimCottee
I know a little about a lot of things and a lot about very little.
Brainbench MVP For Visual Basic
http://www.brainbench.com
MCP, MCSD, MCDBA, CPIM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|