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;"For more information, see: Connection String Format and Attributes

解决方案 »

  1.   

    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;"For a Trusted Connection:oConn.Open "Provider=OraOLEDB.Oracle;" & _
              "Data Source=MyOracleDB;" & _ 
              "User Id=/;" & _
              "Password=;"
    ' OroConn.Open "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: Connecting to an Oracle Database
    (Note, if you get a Logon dialog, then click Cancel, then perform a one-time free signup with Oracle's TechNet system)
      

  2.   

    strConnectString = "Provider=OraOLEDB.Oracle.1;Password=" & strPassWord & _
         ";User ID=" & strUID & ";Data Source=" & strDBName & ";DistribTx=0"