CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Location
    Germany
    Posts
    16

    Oracle-ODBC Provider

    Hi,

    I work with VB6 and an Oracle-database. Until now I use OLE with the following code :

    Set cn = New ADODB.Connection

    With cn
    .Provider = "OraOLEDB.Oracle.1" 'Oracle Provider for OLE DB
    .CommandTimeout = 15
    .Properties("Data Source") = "u8"
    .Properties("User ID") = "test"
    .Properties("Password") = "test"
    .CursorLocation = adUseClient
    End With

    cn.Open

    And now I want to try, how the connection via ODBC works, but I don't know, how I can call the Oracle-ODBC-Provider.

    Please help me,

    Sascha



  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Oracle-ODBC Provider

    You will have to include this in the connectionstring property (and leave away the provider property)

    DRIVER={Microsoft ODBC for Oracle};

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Oracle-ODBC Provider

    Oracle(Microsoft)

    Microsoft OLE DB Provider for Oracle ->MDAORA

    oConn.Open "Provider=msdaora;" & _
    "Data Source=OracleServer.world;" & _
    "User Id=carl;" & _
    "Password=;"



    Oracle(Oracle)

    For Standard Security:

    oConn.Open "Provider=OraOLEDB.Oracle;" & _
    "Data Source=MyOracleDB;" & _
    "User Id=carl;" & _
    "Password=;"

    For a Trusted Connection:

    oConn.Open "Provider=OraOLEDB.Oracle;" & _
    "Data Source=MyOracleDB;" & _
    "User Id=/;" & _
    "Password=;"
    ' Or

    oConn.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.


    'Oracle8
    GetConnectionString = "Provider=MSDAORA.1;Password=" & paswoord & ";User ID=" & user & _
    ";Data Source=" & server & ";Persist Security Info=True"



    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

  4. #4
    Join Date
    Mar 2001
    Location
    Germany
    Posts
    16

    Re: Oracle-ODBC Provider

    Hi,

    I know, that "OraOLEDB.Oracle" is the OLE-Provider for Oracle, but I don't know, what is the ODBC-Provider for Oracle (and from Oracle).

    Sascha


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured