Results 1 to 3 of 3

Thread: Connecting to Oracle

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Slovenia, Europe
    Posts
    58

    Connecting to Oracle

    I would like to connect to an Oracle database.
    Could anyone tell me how to configure my ODBC DNS
    and what is the connection string?

  2. #2
    Fanatic Member Mindcrime's Avatar
    Join Date
    Jun 2001
    Location
    Peterborough, UK
    Posts
    555
    You would be better off using ADO. You will also need the Oracle client installed on your macine and any other machine which will use your Application.

    You will need to include the references to both ADO and Oracle. These are MS Data Environment, MS ActiveX Data Objects, MS Data Formatting Object Library and Oracle InProc Server x.x Type Library.

    Code:
    Dim cn As New ADODB.Connection, rs1 As New ADODB.Recordset
    
        UserConnectionString = "Provider=MSDAORA.1;Password=" _
            & myLoginUserPassword & ";User ID=" & myLoginUserName _
            & ";Data Source=" & myDatabaseServer & ";Persist Security Info=True"
    
        Set cn1 = New ADODB.Connection
        cn1.Open UserConnectionString
        
        Set rs1 = New ADODB.Recordset
        rs1.CursorType = adOpenDynamic
        rs1.LockType = adLockPessimistic
    Thats about it! Hope that helps!
    Last edited by Mindcrime; Jun 15th, 2001 at 12:32 PM.
    Mindcrime : )
    ICQ 24003332

    VB 5.0, VB 6.0 SP5, COM, DCOM, VB.NET Beta 2, Oracle 8

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2000
    Location
    Slovenia, Europe
    Posts
    58
    Thanks it helps a lot.

    , Tadej

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