I have several applications that connect to Oracle. However, I haven't used them very often. But all of a sudden, they all seem to have stopped working. I am getting a TNSNames error, could not resolve service name error.
If this was a new application, I would think that my app was broken. However, these have worked up until the last few months. I know that the database/TNSNames works, because I use TOAD with several databases all the time. There is only one tnsnames.ora on my PC. I had the Microsoft Access Objects 2.8 in my project, but I backed up to 2.6 for something to try. No change. I am connected to the database now, so I know the database itself is up. TNSPING to the server gets an OK back.
I am stuck, I am hoping that someone has a suggestion of what to try or check. There haven't been any changes to the app or the Oracle setup lately that I know....could MS have changed something (a patch?) that might have screwed up my connection?
TIA,
DJM
Code from form:
Option Explicit
Public OraSession As OraSession
Public connect As String
Public Sub cmd_Click(Index As Integer)
If Index = 0 Then
connect = txtField(0) + "/" + txtField(1)
sUserID = txtField(0)
sDatabase = txtField(2)
GoTo ErrorHandler
Else
If Index = 1 Then
End
End If
End If
ErrorHandler:
If OraSession.LastServerErr = 0 Then
If Err = 0 Then
'
'MsgBox ("connected.") ' as " & Connect)
Set OraSession = CreateObject("OracleInProcServer.xorasession")
Set OraDatabase = OraSession.OpenDatabase(txtField(2), connect, 0&)
sDatabase = txtField(2)
Me.Hide
Unload Me
Reset_Menu
frmMain.Show
Else
MsgBox ("
VB=" & Err & " " & Error)
End If
Else
MsgBox (OraSession.LastServerErrText)
End If
End Sub
Public Sub Form_Load()
Set OraSession = CreateObject("Oracleinprocserver.xorasession")
cmd(0).Enabled = False
'txtField(2).text = "PROD"
End Sub
Private Sub Form_Unload(Cancel As Integer)
frmMain.Show
End Sub
Public Sub lblField_Click(Index As Integer)
Select Case Index
Case 0
If (txtField(0) <> "") And (txtField(1) <> "") And (txtField(2) <> "") Then
cmd(0).Enabled = True
cmd(2).Enabled = True
End If
Case 1
Case 2
End Select
End Sub
Public Sub txtField_GotFocus(Index As Integer)
txtField(Index).SelStart = 0
txtField(Index).SelLength = Len(txtField(Index))
End Sub
Private Sub txtField_LostFocus(Index As Integer)
If Len(Trim(txtField(0))) > 0 And Len(Trim(txtField(1))) > 0 And Len(Trim(txtField(2))) > 0 Then
cmd_Click (0)
End If
End Sub
Public Sub txtField_Validate(Index As Integer, Cancel As Boolean)
If (txtField(0) <> "") And (txtField(1) <> "") And (txtField(2) <> "") Then
cmd(0).Enabled = True
End If
End Sub