Here is a basic arrangement of the ADOX Object Model for ADO Extensions.
| ADOX Object Tree |
|---|
|
Here is a simple VB example that gets data from an Excel spreadsheet and sticks it into an array using ADOX objects.
Dim strCnn As String, cnn As ADODB.Connection
Dim cat As ADOX.Catalog, tbl As ADOX.Table, col As ADOX.Column
Dim iTbl As Integer, iCol As Integer
Dim strTbl__ColNames(1 to 100, 1 to 10000) As String
strCnn = "DRIVER={Microsoft Excel Driver(*.xls)}; ReadOnly=1; DBQ=c:\EG1.xls"
Set cnn = New ADODB.Connection
cnn.Open strCnn
Set cat = New ADOX.Catalog
cat.ActiveConnection = cnn1
iTbl = 0
iCol = 0
For Each tbl In cat.Tables
iTbl = iTbl + 1
For Each col In tbl.Columns
iCol = iCol + 1
strColNames(iTbl, ICol) = tbl.Name & "__" & col.Name
Next col
Next tbl
Page Modified: (Hand noted: 2007-10-11 20:28:44Z) (Auto noted: 2007-11-17 06:46:41Z)