|
-
Jul 25th, 2022, 05:50 PM
#1
Thread Starter
Lively Member
[RESOLVED] Programmatically fetching table names from MS Access results in Nothing
For some reason I am getting Nothing for the table name that's pulled from an MS Access db. I just opened the file manually, and there is a Table named "log_returns", so why is this coming up as Nothing?
The code below is used to add the found table names to a ListView. Although there is a table in a .mdb I am opening, there are no tables listed in the ListView, and the row count is zero. Is there an issue with the parameters being pulled from the dt?
[CODE] Dim ConnString As String = "Provider=Microsoft.ACE.OLEDB.12.0; Data source =" & filename
Dim cn As New OleDbConnection(ConnString)
cn.Open()
Dim restrictions() As String = New String(3) {}
restrictions(3) = "Table"
Dim userTables As DataTable = Nothing
userTables = cn.GetSchema("Tables", restrictions)
Dim ListView1 As New ListView
For i = 0 To userTables.Rows.Count - 1
Dim lvi As New ListViewItem(userTables.Rows(i)(2).ToString())
ListView1.Items.Add(lvi)
Next
Last edited by pel11; Jul 27th, 2022 at 11:05 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|