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~

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

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.

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.

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.

@ ~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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.