Display a database's field names
-
I wonder if anyone can help me. I heard that via VB you can run a program to display all the field names within a database. I have tried using schema but have got stuck due to lack of knowledge. Question is, can this be done and am I going in the correct direction? I have a sample of my code, which does not work. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button9.Click Dim rs1 As ADODB.Recordset Dim Cn As New ADODB.Connection cn = New ADODB.Connection Cn.Open("Provider= Microsoft.Jet.OLEDB.4.0; Data Source = C:\nwind.mdb; Persist Security Info = False") rs1 = Cn.OpenSchema(ADODB.SchemaEnum.adSchemaColumns) Do While Not rs1.EOF If (rs1!COLUMN_NAME) <> "" Then 'Debug.Print(rs1!COLUMN_NAME) <=== HOW I DISPLAY THIS IN VB.Net ****** rs1.MoveNext() Else ''display error Exit Do End If Loop End Sub