1 Previous Next 

Access (OleDb): List Database Queries


Use the oledb connections GetOleDbSchemaTable method to list the queries in an access database.
      Imports System.Data.OleDb

Module Module1

    Sub Main()
        Dim strConn As String
        Dim conn As OleDbConnection

        strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
        strConn &= "Data Source = C:\Northwind.mdb;"

        conn = New OleDbConnection(strConn)

        conn.Open()

        Dim dtTableNames As DataTable

        dtTableNames = conn.GetOleDbSchemaTable(OleDbSchemaGuid.Procedures, _
            Nothing)

        conn.Close()

        Dim dr As DataRow

        For Each dr In dtTableNames.Rows
            Trace.WriteLine(dr.Item("PROCEDURE_NAME"))
        Next
    End Sub

End Module



1 Previous Next