Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Populate a ListView with table names
Author:
Daniel M. Ionescu
E-mail:
Click to e-mail author
Submitted:
1/21/2004
Version:
VB6
Compatibility:
VB6
Category:
Controls
Views:
19355
This procedure populates a ListView with the names of the tables which exist in a MSAccess database.
Declarations:
Dim rs As ADODB.Recordset Dim cn As ADODB.Connection
Code:
Public Sub GetLocalTables(LvTable As ListView) Set rs = New ADODB.Recordset Set rs = cn.OpenSchema(adSchemaTables, Array(Empty, Empty, Empty, "TABLE")) Dim i As Long LvTable.ListItems.Clear LvTable.ColumnHeaders.Clear LvTable.ColumnHeaders.Add , , "Tables", 5000 LvTable.View = lvwReport Do Until rs.EOF rs.MoveNext LvTable.ListItems.Add , , rs!table_name, , 2 rs.MoveNext End If Loop rs.Close Set rs = Nothing End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement