Solved

How to read a MSAccess Field's Properties via ADO 2.5

Posted on 2002-03-21
7
276 Views
Last Modified: 2007-12-19
Is it possible to read the Caption property and Validate Text property of a MSAccess 2000 table's field through ADO 2.5? I looked through the properties and couldn't find it. I recently switched from DAO to ADO and am still getting used to the features.

The reason I need this ability is that I wanted to populate my tooltips and validation messages from these properties.

Thanks.
0
Comment
Question by:rbohn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 6887153
You might have a look at the ADODB.Field.Attributes Collection.

Might be there, but I kind of doubt it...
0
 

Author Comment

by:rbohn
ID: 6887169
I looked through Attributes, but the only thing I found useful from there was the property for allow zero length string.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6887520
see the OpenSchema method (from the Connection object).
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 52

Accepted Solution

by:
Ryan Chong earned 100 total points
ID: 6887559
Hi rbohn,

This example use ADOX to get the properties of fields and display it into a ListView Control:

Private Sub showFieldNameADO(ByVal DBFullPath As String, ByVal sTable As String)
    'On Error GoTo ErrorHandler
   
    Dim oCat As ADOX.Catalog
    Dim oTable As ADOX.Table
   
    ListView1.ListItems.Clear
   
    Set oCat = New ADOX.Catalog
    oCat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                            "Data Source=" & DBFullPath & ";"
   
    For Each oTable In oCat.Tables
        If UCase(oTable.Name) = UCase(sTable) Then
            For i = 0 To oTable.Columns.Count - 1
                ListView1.ListItems.Add i + 1, , oTable.Columns(i).Name
                ListView1.ListItems(i + 1).SubItems(1) = GetDataTypeString(oTable.Columns(i).Type)
                ListView1.ListItems(i + 1).SubItems(2) = oTable.Columns(i).DefinedSize
                ListView1.ListItems(i + 1).SubItems(3) = oTable.Columns(i).Properties(2).Value
            Next i
        End If
    Next
   
    Set oTable = Nothing
    Set oCat = Nothing
   
    Exit Sub
ErrorHandler:
    MsgBox Err.Number & ": " & Err.Description
End Sub

Basically use: oTable.Columns(i).Properties(N).Value to get the property value

Hope this help
0
 
LVL 52

Expert Comment

by:Ryan Chong
ID: 6887566
Try:

oTable.Columns(i).Properties("Jet OLEDB:Allow Zero Length").Value to get the Value.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7060592
This question appears to be abandoned. A question regarding it will be left in the Community Support
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to accept the comment
of <ryancys>.

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7065684
rbohn logged in right after you posted this request and chose not to respond, so I can only assume Asker agrees and closed this.

Thanks for your help.

Moondancer - EE Moderator
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month6 days, 9 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question