说的不明白。如果是需要建两个连接设2个_connectionPtr变量不就得了

解决方案 »

  1.   

    你这连接是两个database吗?那就要两个_ConnectionPtr,使用两个不同的连接字符串connection string
      

  2.   

    我也不明白,为什么要两个连接?
    即便是如strip(阿飞) 所说有两个database,但可以公用一个服务。
    而ado连接oracle是连接服务而不是database
      

  3.   

    是呀, beegee(提头游于市--别怕,是我自己的猪头) 说的对!
    可以只用一个_ConnectionPtr pConn;
    用两个_RecordsetPtr pSet1,pSet2;
    pSet1=pConn->Execut("Select * from Table1 where ...");
    pSet2=pConn->Execut("Select * from Table2 where ..."):
      

  4.   

    to  beegee:
    在oracle里面一个database就是一个服务/连接(oracle 叫这个叫连接) :) (和ms sql server不一样)to pfans(pfans) :
    你那是两个table, not two databases
      

  5.   

    谢谢你们和我讨论!
    可能是我没说清楚,我指的不是两个table,而是两个database。
    该问题其实不是个编程问题。请打开Oracle的Net8 Assistant,对Oracle的“Oracle Names Services”进行配置,该界面是java写的,怪怪的,慢慢的。选中你要处理的服务后,(比如“work.someplace.com”)将右边最上面那个象listbox的控件选中为“配置服务器”,再点击下面的绿色的“+”就可以为该服务添加一个database了……
    我老是说“服务”,可能是用词不当,见谅,其实看看ADO连接你就知道了:
    连接字是:
    conStr = "Provider=MSDAORA;Data Source=work.someplace.com;User ID=__;Password=___;"