Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
The code below works great for receiving some of the names of databases in my connection to our server. However we have 150+ databases and this only returns about 30 (the first ~30 in the list).

Similarly, I can only successfully write to these 30, because attempting to write to one of the unlisted datatables will result in a 'datatable not found error'.

What makes it weird, though, is that this DB connection is the same one I use for retrieving information from ANY of the datatables, including the ones not listed in the 30 it allows me to write to.

I guess I have 2 immediate questions:
1) How can I use OpenSchema to view all datatables through this connection?
2) Any suggestions on how to go about writing to the other datatables?


VB
Dim db As New Connection
Dim da As New System.Data.OleDb.OleDbDataAdapter
Dim tablesSchema As ADODB.Recordset
Try
    db.CursorLocation = CursorLocationEnum.adUseClient
    db.Open("stuff")
    tablesSchema = db.OpenSchema(SchemaEnum.adSchemaTables)
    Dim myTable As New DataTable
    da.Fill(myTable, tablesSchema)
    MyDataViewerForm.LoadSimpleDataGrid(myTable)
Catch ex As Exception
    MsgBox(ex.ToString)
Finally
    db.Close()
    da.Dispose()
    da = Nothing
    db = Nothing
End Try
Posted
Comments
RavonX 22-Jan-15 16:07pm    
There's only 33 that get returned every time..
Been looking a lot of places for alternate solutions or fixes. No luck yet.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900