Add Database Names, table names & related fields from table in
Yes, after all, you can enumerate the database names!! HEre's how:
Sub ss()
cn='your connection string
set xx = CreateObject("ADODB.Connection")
xx.Open cn
set xy = xx.OpenSchema(1) ' Catalogs
debug.print xy.GetString ' prints the names of the databases, delimited
by vbCRLF
End Sub
The xy object has a number of methods; use the GetRows method (with the
appropriate argument) to get 1 row at a time and add it to your COMBO.
You might want to use Early Binding: then Intellisense will give you all
the clues you need.
|