0

I have a program that imports table names into a treeview, however the problem I am having is it will only import 10 table names then stop. I have 26 table names to import. Is there a away to get around this without having to split it into three different databases? Please help thank you!

~GGK~

5
Contributors
5
Replies
6
Views
11 Years
Discussion Span
Last Post by hatem
0

Are you sure the VB program is only reading 10 table names from the database, or is the treeview only displaying 10 items?

0

Are you sure the VB program is only reading 10 table names from the database, or is the treeview only displaying 10 items?

Now that is a very interesting point to look at it. I assumed that VB stopped at 10 and wouldnt import any more because I have seen the same thing in another program. However I think in the other program they had the Table Names display in a list view which would be for sure capable of handling more than 10 items.

I guess it would be safe to say that VB is not importing more than 10 Table Name from a database.

0

hey , how u doing ?

please i want the code that you can import the tables

from database and display them in a treeview .

you will help me very much .

and thanks very much.

0

Hi.

I have a similiar function in the database administration part of a program.
I have NO problem reading more than 10 table names.

Dim dbfTableData As Database
Dim tdfTables As TableDefs, tdfSelectedTable As TableDef
Set dbfTableData = DBEngine.Workspaces(0).OpenDatabase(dbDatabaseName.Text, False, True)

Set tdfTables = dbfTableData.TableDefs
dbTableName.Clear
For Each tdfSelectedTable In tdfTables
If Left(tdfSelectedTable.name, 4) = "MSys" Then GoTo moveOn
dbTableName.AddItem (tdfSelectedTable.name)

moveOn:
Next
dbfTableData.Close

In the above code 'dbDatabaseName' is retrieved from a 'Open File' dialog, and 'dbTableName' is a combo box.
I've tested the code with Access DB 97-2002 with 16 tables.

0

@ ~GGK~
Try this one,

Dim dbs As Database
Dim td As TableDef
Set dbs = OpenDatabase(App.Path & "\mydata.mdb")

For Each td In dbs.TableDefs
If Left$(td.Name, 4) <> "MSys" Then
Combo1.AddItem td.Name
End If
Next

This article has been dead for over six months. Start a new discussion instead.
Take the time to help us to help you. Please be thoughtful and detailed and be sure to adhere to our posting rules.