Multiple DB connections

I am trying to get this ‘integrator’ app to connect to multiple CubeSQL databases located in different hosts…

So I thought I should start by creating as many connections as DBs I want to connect to. But the amount of DB’s to connect to is not a fixed number… it can be 1 to 5…

The question is… how do I dynamically create DB connections ? I need to create like a control set but of CubeSQLserver objects

I just don’t know how to do it…

Please enlighten me…

Not sure I really understand the issue you’re having. You can create an array of database connections. When you know which database you want to connect to, either by name or IP address, you can iterate the array and search for the correct one and return it.

No, you are right, Bob… I didn’t understand the problem either… this is so simple I can’t believe I asked…

I got stuck in my own mess… and did not think that I could just create an array of DB connections…

I guess I need some rest.

Thanks

Create array with size -1, so it’s empty.

later you can get database connection:

dim d as database = OpenDatabase connections.append d

Using append (and remove) methods you can dynamically resize arrays.