Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
In DAO, I could get all table information by using "for each e in currentdb.tabledefs". How can I do similar thing in ADO? Thanks in advance! KS |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try searching on ADOX
Tim -- Tim Williams Palo Alto, CA "KS Wong" wrote in message ... Hi all, In DAO, I could get all table information by using "for each e in currentdb.tabledefs". How can I do similar thing in ADO? Thanks in advance! KS |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub GetTables()
Dim oConn As Object Const sFilename As String = "C:\myTest\18.xls" Dim oCat As Object Dim tbl As Object Dim iRow As Long Dim sConnString As String sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & sFilename & ";" & _ "Extended Properties=Excel 8.0;" Set oConn = CreateObject("ADODB.Connection") oConn.Open sConnString Set oCat = CreateObject("ADOX.Catalog") Set oCat.ActiveConnection = oConn iRow = 1 For Each tbl In oCat.Tables Next tbl oConn.Close Set oCat = Nothing End Sub -- HTH RP (remove nothere from the email address if mailing direct) "KS Wong" wrote in message ... Hi all, In DAO, I could get all table information by using "for each e in currentdb.tabledefs". How can I do similar thing in ADO? Thanks in advance! KS |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I got it! Thank you very much!
"Bob Phillips" wrote: Sub GetTables() Dim oConn As Object Const sFilename As String = "C:\myTest\18.xls" Dim oCat As Object Dim tbl As Object Dim iRow As Long Dim sConnString As String sConnString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & sFilename & ";" & _ "Extended Properties=Excel 8.0;" Set oConn = CreateObject("ADODB.Connection") oConn.Open sConnString Set oCat = CreateObject("ADOX.Catalog") Set oCat.ActiveConnection = oConn iRow = 1 For Each tbl In oCat.Tables Next tbl oConn.Close Set oCat = Nothing End Sub -- HTH RP (remove nothere from the email address if mailing direct) "KS Wong" wrote in message ... Hi all, In DAO, I could get all table information by using "for each e in currentdb.tabledefs". How can I do similar thing in ADO? Thanks in advance! KS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
Read-write/Read-only | Excel Discussion (Misc queries) | |||
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
read from 1 cell read to and other using vba | Excel Programming |