How do I get a list of all tables of Oracle DB?
Following is the code in which i have marked the point (in comments) where I need assistance
Sub OracleToExcel()
Dim conn As New ADODB.Connection
conn.Open "driver={Microsoft ODBC for Oracle};" & _
"server=
js;" & _
"uid=hsonsche;pwd=hsons"
'here I need an array to contain names of all tables in the database
'The array is to be listed on the sheet1 of active workbook first.
'Then following part of the VBA is to be executed for all tables in the array one-by-one
Dim rs As New Recordset
Tabname = "supplier"
rs.Open "Select * From " & Tabname, conn, adOpenStatic, adLockReadOnly, adCmdText
Workbooks.Add
ActiveCell = "Table Name " & Tabname
ActiveCell.Offset(1, 0).Select
x = 1
For k = 0 To rs.Fields.Count - 1
ActiveCell.Offset(0, k) = rs(k).Name
Next
ActiveCell.Offset(1, 0).Select
ActiveWindow.FreezePanes = True
MsgBox (rs.RecordCount & vbCr & "records")
Do While Not rs.EOF
For k = 0 To rs.Fields.Count - 1
ActiveCell.Offset(0, k) = rs(k).Value
Next
ActiveCell.Offset(1, 0).Select
rs.MoveNext
'rs.MoveFirst
Loop
'Close the recordset
rs.Close
conn.Close
End Sub