View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default get column name by ADOX

Change the following part of my previous post as shown below...

---
Another way...

Dim sTableNames As String, sTableName As String
For Each tbl In cat.Tables
sTableName = Replace(tbl.Name, "$", "")
sTableNames = sTableNames & "|" & sTableName
Next 'tbl


Dim vTableNames, aListItems() '//**change1

vTableNames = Split(Mid$(sTableNames, 2), "|")
Dim lNumTables As Long, i As Long
lNumTables = UBound(vTableNames)


ReDim aListItems(lNumTables, 1) '//**change2

For i = LBound(vTableNames) To UBound(vTableNames)
aListItems(i, 0) = vTableNames(i)
aListItems(i, 1) = cat.Tables(i + 1).Name
Next 'i
ListBox1.ColumnCount = 2
ListBox1.List = aListItems

HTH


--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc