Click here to Skip to main content
15,918,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

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

VB
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
VB
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

VB
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
Updated 4-Oct-12 18:23pm
v2

1 solution

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

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900