使用ADO读写数据,然后你直接创建N个cn字符串就可以了。比如
Dim cnA As NEW ADODB.Connection
Dim cnB As NEW ADODB.Connection
Dim cnC As NEW ADODB.Connection
cnA.Open "Provider=SQLOLEDB;Data Source=192.168.1.102,1433;Database=DataA", "sa", "sa"
cnB.Open "Provider=SQLOLEDB;Data Source=192.168.1.102,1433;Database=DataB", "sa", "sa"
cnC.Open "Provider=SQLOLEDB;Data Source=192.168.1.105,1433;Database=DataC", "sa", "sa"