Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. get DB schema

get DB schema

Scheduled Pinned Locked Moved Visual Basic
databasexmlquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Silly Boy
    wrote on last edited by
    #1

    Hi every body! please tell me how can i get a data type of a field in data base!!! Thanks! xyz

    D 1 Reply Last reply
    0
    • S Silly Boy

      Hi every body! please tell me how can i get a data type of a field in data base!!! Thanks! xyz

      D Offline
      D Offline
      Dr_X
      wrote on last edited by
      #2

      I have not done it in .Net yet but in the old VB you need to set a reference to: 'Microsoft ADO Ext. 2.7 for DDL and Security'. You many have another version than 2.7 but you get the idea.

      Dim cn As ADODB.Connection
      Dim sch As New ADOX.Catalog
      cn = New Connection
      cn.ConnectionString = ConnectString
      cn.Open
      sch.ActiveConnection = cn
      Dim t As ADOX.Table
      Dim c As ADOX.Column
      Set t = sch.Tables("TableName")
      Set c = t.Columns("ColumnName")
      Debug.Print c.Type

      Michael I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups