Click here to Skip to main content
12,757,627 members (36,302 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB Oracle VB.NET
Hi all,

Can I know what is the possible connection string and what most stable connection string to connect with oracle 10g client? because I'm in a situation where the connection and transaction either must use OleDBConnection or OdbcConnection..
Example:

Private m_MSSQLCN As OleDbConnection
Private m_MSSQLTR As OleDbTransaction
Private m_ODBCCN As OdbcConnection
Private m_ODBCTR As OdbcTransaction

Public Overridable Function OpenConnection_OleDB() As OleDbConnection

If (Not IsNothing(m_MSSQLCN)) Then
    If (m_MSSQLCN.State = ConnectionState.Open) Then
        m_MSSQLCN.Close()
    End If

    m_MSSQLCN= New OleDbConnection(MyBase.DBConnString)
    m_MSSQLCN.Open()
    Return m_MSSQLCN
End If

End Function

or
Public Overridable Function OpenConnection_ODBC() As OdbcConnection

If (Not IsNothing(m_ODBCCN)) Then
    If (m_ODBCCN.State = ConnectionState.Open) Then
        m_ODBCCN.Close()
    End If

    m_ODBCCN = New OdbcConnection(MyBase.DBConnString)
    m_ODBCCN.Open()
    Return m_ODBCCN
End If

End Function

ReadOnly Property DBConnString() As String

Get
   Return "DSN=" & clsGlobVars.strDataSource & ";UID=" & clsGlobVars.strUserID &
          ";PWD=" & clsGlobVars.strPassword & ";"
End Get

End Property


Currently I'm using DSN,UID,PWD for ConnStr. If anyone know others,please help me..
Asking help from expertise for this..tq
Posted 4-Oct-12 19:22pm
Updated 4-Oct-12 19:23pm
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I would suggest to go with this link for possible connection string formats.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 5 Oct 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100