get DB schema
-
Hi every body! please tell me how can i get a data type of a field in data base!!! Thanks! xyz
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.TypeMichael 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)