使用ADO控件,自已查一下属性就行了

解决方案 »

  1.   

    和sql差不多
    .Provider = "MSDataShape"
    .Open "Driver={Microsoft ODBC for Oracle};Server=" & strServerName, strUserName, strUserPwd
      

  2.   

    1 Must install oracle SQL*NET
    2 Configure the connection to the Oracle Server(Use SQL*NET Easy configuration)
    3 Establish ADO connection,there two ways:use microsoft oracle oledb or odbc driver
      

  3.   

    strConnectString = "Provider=OraOLEDB.Oracle.1;Password=" & strPassWord & _
           ";User ID=" & strUID & ";Data Source=" & strDBName & ";DistribTx=0"
    最后一个参数很有必要
      

  4.   

    给你一个现成的例子
    (注意:
    1)需要先将“ADO ...”加入 VBP,具体方法为:"Project --> "References"后出现的选择对话框中选中“MicorSoft ActiveX Data Object 2.0 Libtary”")
    2)ADO_XXX是从控制面板设置的ODBC连接串名称.
    3)还有问题的话请留短消息--我不保证每次都看一样的问题。'
    ' @(h) modAdoApp.bas
    '
    'Use:
    '   Ado 实用函数
    '
    '
    'First Creat Author : TNT1900
    'Frist Creat Date   : 2002.07.12
    '
    'Last Vindicator    : TNT1900
    'Last Modify Date   : 2002.08.01
    'Option Explicit'' 全局数据库连接串
    Global Const G_ADO_ConStr As String = "Provider=MSDAORA.1; " & _
        "User ID=UserID; password=PSW; Data Source=ADO_XXX; Persist Security Info=False"
    '
    'Use:
    '   根据指定的 SQL 语句和具体可选条件执行 SQL 命令并返回相应的结果
    '
    'Input:
    '   strSource   :   完整、有效的语句如SQL语句等
    '   Optional intCursorType As CursorTypeEnum = adOpenForwardOnly,
    '   Optional intLockType As LockTypeEnum = adLockReadOnly,
    '   Optional intOptns As CommandTypeEnum = adCmdText,
    '   Optional intDynaFlag As Integer = 0 :   默认不需要 RecordCount,为 1 则该属性有效
    '
    'Return:
    '   相应的记录集结果
    '
    'Call Example:
    '   intRtn = cgfn_GetDataBySourceAndOptn("Select * from T_Employee")
    '
    'Notice:
    '   数据的唯一性由数据库保证。
    '
    'First Creat Author : TNT1900
    'Frist Creat Date   : 2002.07.12
    '
    'Last Vindicator    : TNT1900
    'Last Modify Date   : 2002.07.12
    '
    Public Function cgfn_GetDataBySourceAndOptn( _
        ByVal strSource As String, _
        Optional intCursorType As CursorTypeEnum = adOpenForwardOnly, _
        Optional intLockType As LockTypeEnum = adLockReadOnly, _
        Optional intOptns As CommandTypeEnum = adCmdText, _
        Optional intDynaFlag As Integer = 0 _
    ) As ADODB.Recordset
        
    On Error GoTo ErrorProcess
        
        Dim Conn As ADODB.Connection
        Dim p_RS As ADODB.Recordset
        
        '' 如果SQL语句什么也没有的话则什么也不做,直接退出
        If strSource = "" Then Exit Function
        
        '' Initialize the ADODB connection and recordset
        Set Conn = New ADODB.Connection
        Set p_RS = New ADODB.Recordset
        
        '' 此参数专门为 ORACLE 量身定制:指定此参数=1时,才能得到 Recordcount等属性
        If intDynaFlag = 1 Then
            p_RS.CursorLocation = adUseClient
        End If
        
        '' Open the Connection
        Conn.Open G_ADO_ConStr
        
        '' Get the recordset
        p_RS.Open strSource, Conn, intCursorType, intLockType, intOptns
        
        '' Return the value
        Set cgfn_GetDataBySourceAndOptn = p_RS
        
        '' Normal Exit
        Exit Function
        
    '' 出错处理
    ErrorProcess:
        'cgsb_ErrorProcess "modAdoApp.cgfn_GetDataBySourceAndOptn()"
        Resume Next     '' 跳到当前程序的下一步,continue
    End Function
      

  5.   

    我用ADO,但有一个ORACLE的控件~~~
    http://www.oradb.net/setup/vbora_002.htm