Results 1 to 3 of 3

Thread: [RESOLVED] [VB6] ADOX: get datatype of a Column

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2004
    Location
    Philippines
    Posts
    285

    Resolved [RESOLVED] [VB6] ADOX: get datatype of a Column

    hi everyone. can someone please tell me how to get the datatype of a Column of a Table in ADOX?

    I was able to successfully get all the the tables and fields of my MSAccess database but i don't know how to get the datatype of each fields.

    i have this code to get all the fields for a given table:
    Code:
    Private Sub lvwTables_ItemClick(ByVal Item As MSComctlLib.ListItem)
        Dim oCol As ADOX.Column
        Dim x As Integer
        Dim iIndex As Integer
        Dim iList As ListItem
        Dim prop As ADOX.Property
        
        
        iIndex = Val(Item.SubItems(3))
        
        lvwFields.ListItems.Clear
        For x = 0 To m_Cat.Tables(iIndex).Columns.Count - 1
            Set oCol = m_Cat.Tables(iIndex).Columns(x)
            Set iList = lvwFields.ListItems.Add(, , oCol.Name)
            
            'testing
            For Each prop In oCol.Properties
                Debug.Print prop.Name & " = " & prop.Value
            Next
        Next
    End Sub
    the properties collection has only the following data:
    HTML Code:
    Autoincrement = False
    Default = 
    Description = 
    Nullable = True
    Fixed Length = False
    Seed = 1
    Increment = 1
    Jet OLEDB:Column Validation Text = 
    Jet OLEDB:Column Validation Rule = 
    Jet OLEDB:IISAM Not Last Column = False
    Jet OLEDB:AutoGenerate = False
    Jet OLEDB:One BLOB per Page = False
    Jet OLEDB:Compressed UNICODE Strings = True
    Jet OLEDB:Allow Zero Length = True
    Jet OLEDB:Hyperlink = False
    thanks.

    -guyjasper

  2. #2
    Hyperactive Member
    Join Date
    May 2006
    Posts
    365

    Re: [VB6] ADOX: get datatype of a Column

    Hello Jasper

    Please follow the link http://www.vbforums.com/showthread.p...46#post2812346

    Kind regards

    Steve

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2004
    Location
    Philippines
    Posts
    285

    Re: [VB6] ADOX: get datatype of a Column

    wow, thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width