我的程序要读写 Oracle 数据库,开始我设置 Provider=OraOLEDB.Oracle.1,在自己的机子上可以正常运行,但拿到别人的机子上就不行了,修改成 Provider=MSDAORA.1 后才能正常连接。请问这个参数是不是跟本地机的设置有关?
如果有,我怎样知道在哪台机子上该用什么设置。
另外,User ID 是不是很重要,是不是没有这个参数,在某些机器上就无法连接数据库????
感激不尽!

解决方案 »

  1.   

    The Microsoft OLE DB Provider for Oracle allows ADO to access Oracle databases.strConnect = _T("Provider=MSDAORA;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;");
      

  2.   

    public,谢谢你的回答,但是我看了后还是不太明白。
    MSDAORA 是不是在所有的地方都能用???
      

  3.   

    ODBC Driver for Oracle 
    For the current Oracle ODBC Driver from Microsoft:oConn.Open "Driver={Microsoft ODBC for Oracle};" & _
              "Server=OracleServer.world;" & _
              "Uid=myUsername;" & _
              "Pwd=myPassword;"For the older Oracle ODBC Driver from Microsoft:oConn.Open "Driver={Microsoft ODBC Driver for Oracle};" & _
              "ConnectString=OracleServer.world;" & _
              "Uid=myUsername;" & _
              "Pwd=myPassword;"
      

  4.   

    ODBC Driver for Oracle 
    For the current Oracle ODBC Driver from Microsoft:oConn.Open "Driver={Microsoft ODBC for Oracle};" & _
              "Server=OracleServer.world;" & _
              "Uid=myUsername;" & _
              "Pwd=myPassword;"For the older Oracle ODBC Driver from Microsoft:oConn.Open "Driver={Microsoft ODBC Driver for Oracle};" & _
              "ConnectString=OracleServer.world;" & _
              "Uid=myUsername;" & _
              "Pwd=myPassword;"
      

  5.   

    OLE DB Provider for Oracle (from Microsoft) 
      
    oConn.Open "Provider=msdaora;" & _
              "Data Source=MyOracleDB;" & _ 
              "User Id=myUsername;" & _
              "Password=myPassword;"For more information, see: Microsoft OLE DB Provider for Oracle
    OLE DB Provider for Oracle (from Oracle) 
      
    For Standard Security:oConn.Open "Provider=OraOLEDB.Oracle;" & _
              "Data Source=MyOracleDB;" & _ 
              "User Id=myUsername;" & _
              "Password=myPassword;"
      

  6.   

    OLE DB Provider for OracleOLE DB Provider for Oracle (from Microsoft)The Microsoft OLE DB Provider for Oracle allows ADO to access Oracle databases.strConnect = _T("Provider=MSDAORA;Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;");For more information, see: Microsoft OLE DB Provider for OracleOLE DB Provider for Oracle (from Oracle)For Standard Security:strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;"
    "User Id=myUsername;Password=myPassword;");For a Trusted Connection:   OS Authenticated connect setting user ID to "/"strConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;User Id=/;Password=;");   OS Authenticated connect using OSAuthentstrConnect = _T("Provider=OraOLEDB.Oracle;Data Source=MyOracleDB;OSAuthent=1;")Note: "Data Source=" must be set to the appropriate Net8 name which is known to the naming method in use. For example, for Local Naming, it is the alias in the tnsnames.ora file; for Oracle Names, it is the Net8 Service Name.For more information, see: Oracle Provider for OLE DB Developer's Guide
      

  7.   

    Microsoft OLE DB Provider for Oracle
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdreforacleprovspec.asp?frame=true
     Oracle Provider for OLE DB Developer's Guide
    http://download-west.oracle.com/otndoc/oracle9i/901_doc/win.901/a90171/using.htm