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. Display a database's field names

Display a database's field names

Scheduled Pinned Locked Moved Visual Basic
helpdatabasequestioncsharp
1 Posts 1 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.
  • D Offline
    D Offline
    directred
    wrote on last edited by
    #1

    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

    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