与SQL Server并没有什么不同,安装客户端,配置名称后连接即可
Provider=MSDAORA.1;Password=sys;User ID=sys;Data Source=oradb.machinename;Persist Security Info=True

解决方案 »

  1.   

    我提供用Ado连接的方案如下:
    dim cnn as new adodb.connection
    str = "Provider=MSDAORA.1;Password=sys;User ID=sys;Data Source=oradb.machinename;Persist Security Info=True"
    str1 = yourusername
    str2 = yourpassword
    cnn.open str,str1.str2,-1
      

  2.   

    建立一个用户dsn,让后再用ado连接就行了么
      

  3.   

    dim gcnOracle as new ADODB.connection    With gcnOracle
            If .State = adStateOpen Then .Close
            .Provider = "MSDataShape"
            .Open "Driver={Microsoft ODBC for Oracle};Server=" & strServerName, strUserName, strUserPwd
        End With
        If Err <> 0 Then
            OraDataOpen = False
            MsgBox "由于用户、口令或服务器指定错误,无法注册。", vbExclamation, gstrSysName
            Exit Function
        End If
      

  4.   

    '连接服务器(RDO、ODBC)
    Public Function ConnectServer(ByVal ServerName As String, ByVal DBName As String, ByVal UserName As String, ByVal PWD As String) As Boolean    Dim ConnectString As String    On Error GoTo Error_ConnectServer    rdoEngine(0).CursorDriver = rdUseClientBatch
        ConnectString = "Driver={Microsoft ODBC For Oracle};Server=" & DBName & "_" & ServerName & ";UID=" & UserName & ";PWD=" & PWD & ";"
        Set grdoCN = rdoEngine(0).OpenConnection("", rdDriverNoPrompt, False, ConnectString) ', rdAsyncEnable)    ConnectServer = True
        Exit FunctionError_ConnectServer:
        ConnectServer = False
    End Function
    '连接数据库(ADO、ODBC)
    Public Function ConnectOracleServer(ByVal ServerName As String, ByVal DBName As String, ByVal UserName As String, ByVal PWD As String) As Boolean
        Dim strConnect As String    On Error GoTo Error_ConnectOracleServer    strConnect = "Driver={Microsoft ODBC For Oracle};Server=" & DBName & "_" & ServerName & ";UID=" & UserName & ";PWD=" & PWD & ";"
        adoORACLEConnect.Open strConnect    ConnectOracleServer = True
        Exit FunctionError_ConnectOracleServer:
        ConnectOracleServer = False
    End Function