If you are connected to the VServer as admin, you can send the SQL command :
Show Databases
If you are not admin, you can only know the registered databases. You can write :
dim myServer As VServer
dim dbi As DatabaseInfo
dim n As Integer
dim dbListNames As String
myServer = new VServer(app.myConnection)
if myServer <> nil then
// As you don't need to know the first (that is "master.vdb")
// you can start at 2 (n = 2)
For n = 2 To myServer.DatabaseCount
dbi = myServer.DatabaseInfo(n)
if dbi <> nil then
dbListNames = dbListNames + ";" + dbi.Name
end if
next
dbListNames = Mid(dbListNames, 2)
end if