lgullapudi
Programmer
could you please help me...
Getting error as "RXP was unable to connect to the database" when i was trying to open the application and this exception is coming at the line tdfTable.RefreshLink.
It was working fine previously ,but i think its not working after Database upgrade from Oracle 10g to Oracle 11g.
Code :
could you please help me...
Getting error as " when i was trying to open the application and this exception is coming at the line tdfTable.RefreshLink.
It was working fine previously but i think its not working after Database upgrade from Oracle 10g to Oracle 11g.
Code :
Option Compare Database
Option Explicit
Dim mstrUserId As String
Dim mstrPassword As String
Const theConnectString = "usa1111ab2269.apps.mc.xerox.com:1551/RXP102;"
Function ValidateInput() As Boolean
Dim strConnect As String
Dim strValid As String
Dim con As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
' A username must be entered
txtUsername.SetFocus
If Len(txtUsername.Text) = 0 Then
MsgBox "Username is missing.", vbExclamation, "SOLOS - D1J"
ValidateInput = False
Exit Function
End If
' A password must be entered
txtPassword.SetFocus
If IsNull(txtPassword) Then
txtPassword.Value = ""
End If
If Len(txtPassword.Text) = 0 Then
MsgBox "Password is missing.", vbExclamation, "SOLOS - D1J"
ValidateInput = False
Exit Function
End If
strConnect = "DRIVER={Microsoft ODBC for Oracle};" & _
"SERVER=" & theConnectString & _
"UID=" + "RXPLOGIN" + ";" & _
"PWD=" + "NIGOLJ1D" + ";"
Set con = New ADODB.Connection
con.ConnectionString = strConnect
con.Open
Set cmd = New ADODB.Command
cmd.ActiveConnection = con
cmd.CommandText = "RXP.RXP_LOGIN"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Refresh
cmd.Parameters("insUserId") = txtUsername.Value
cmd.Parameters("insPassword") = txtPassword.Value
cmd.Parameters("innMdbVersion") = 1
Set rs = cmd.Execute
strValid = cmd.Parameters("outsValid")
If strValid <> "Y" Then
If strValid = "I" Then
MsgBox "Username / Password is not valid", vbExclamation, "SOLOS - D1J"
ElseIf strValid = "V" Then
MsgBox "Your SOLOS D1J access database is obsolete and needs to be replaced with the latest version.", vbExclamation, "SOLOS - D1J"
Else
MsgBox "An unexpected user id validation error as occurred.", vbExclamation, "SOLOS - D1J"
End If
ValidateInput = False
Exit Function
End If
'these are used later to refresh the conneciton to the master file view
mstrUserId = cmd.Parameters("outsUserId")
mstrPassword = cmd.Parameters("outsPassword")
ValidateInput = True
End Function
Function InitializeConnection() As Boolean
Dim strConnect As String
Dim dbs As DAO.Database
Dim tdfTable As DAO.TableDef
On Error GoTo ErrorHandler
Set dbs = CurrentDb
'note that mstrUserid and mstrPassword are retrieved from a previious
'call to the D1J_LOGIN stored procedure
strConnect = "DRIVER={Microsoft ODBC for Oracle};" & _
"SERVER=" & theConnectString & _
"UID=" + mstrUserId + ";" & _
"PWD=" + mstrPassword + ";"
' Refresh Access Linked Tables
For Each tdfTable In dbs.TableDefs
' Only attempt to refresh link on tables that already
' have a connect string (linked tables only)
If Len(tdfTable.Connect) > 0 Then
' Set the tables connection string
tdfTable.Connect = strConnect
' Refresh the link to the table
[highlight #F57900]tdfTable.RefreshLink[/highlight]
End If
Next
InitializeConnection = True
Exit Function
ErrorHandler:
MsgBox "RXP was unable to connect to the database", vbExclamation, "RXP - LOGIN"
InitializeConnection = False
End Function
Private Sub cmdCancel_Click()
CurrentDb.Close
Quit
End Sub
Private Sub cmdOk_Click()
Screen.MousePointer = 11
If ValidateInput() Then
If InitializeConnection() Then
DoCmd.Close acForm, "frmLogin"
End If
End If
Screen.MousePointer = 1
End Sub
Private Sub Form_Activate()
txtUsername.SetFocus
End Sub
Getting error as "RXP was unable to connect to the database" when i was trying to open the application and this exception is coming at the line tdfTable.RefreshLink.
It was working fine previously ,but i think its not working after Database upgrade from Oracle 10g to Oracle 11g.
Code :
could you please help me...
Getting error as " when i was trying to open the application and this exception is coming at the line tdfTable.RefreshLink.
It was working fine previously but i think its not working after Database upgrade from Oracle 10g to Oracle 11g.
Code :
Option Compare Database
Option Explicit
Dim mstrUserId As String
Dim mstrPassword As String
Const theConnectString = "usa1111ab2269.apps.mc.xerox.com:1551/RXP102;"
Function ValidateInput() As Boolean
Dim strConnect As String
Dim strValid As String
Dim con As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
' A username must be entered
txtUsername.SetFocus
If Len(txtUsername.Text) = 0 Then
MsgBox "Username is missing.", vbExclamation, "SOLOS - D1J"
ValidateInput = False
Exit Function
End If
' A password must be entered
txtPassword.SetFocus
If IsNull(txtPassword) Then
txtPassword.Value = ""
End If
If Len(txtPassword.Text) = 0 Then
MsgBox "Password is missing.", vbExclamation, "SOLOS - D1J"
ValidateInput = False
Exit Function
End If
strConnect = "DRIVER={Microsoft ODBC for Oracle};" & _
"SERVER=" & theConnectString & _
"UID=" + "RXPLOGIN" + ";" & _
"PWD=" + "NIGOLJ1D" + ";"
Set con = New ADODB.Connection
con.ConnectionString = strConnect
con.Open
Set cmd = New ADODB.Command
cmd.ActiveConnection = con
cmd.CommandText = "RXP.RXP_LOGIN"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Refresh
cmd.Parameters("insUserId") = txtUsername.Value
cmd.Parameters("insPassword") = txtPassword.Value
cmd.Parameters("innMdbVersion") = 1
Set rs = cmd.Execute
strValid = cmd.Parameters("outsValid")
If strValid <> "Y" Then
If strValid = "I" Then
MsgBox "Username / Password is not valid", vbExclamation, "SOLOS - D1J"
ElseIf strValid = "V" Then
MsgBox "Your SOLOS D1J access database is obsolete and needs to be replaced with the latest version.", vbExclamation, "SOLOS - D1J"
Else
MsgBox "An unexpected user id validation error as occurred.", vbExclamation, "SOLOS - D1J"
End If
ValidateInput = False
Exit Function
End If
'these are used later to refresh the conneciton to the master file view
mstrUserId = cmd.Parameters("outsUserId")
mstrPassword = cmd.Parameters("outsPassword")
ValidateInput = True
End Function
Function InitializeConnection() As Boolean
Dim strConnect As String
Dim dbs As DAO.Database
Dim tdfTable As DAO.TableDef
On Error GoTo ErrorHandler
Set dbs = CurrentDb
'note that mstrUserid and mstrPassword are retrieved from a previious
'call to the D1J_LOGIN stored procedure
strConnect = "DRIVER={Microsoft ODBC for Oracle};" & _
"SERVER=" & theConnectString & _
"UID=" + mstrUserId + ";" & _
"PWD=" + mstrPassword + ";"
' Refresh Access Linked Tables
For Each tdfTable In dbs.TableDefs
' Only attempt to refresh link on tables that already
' have a connect string (linked tables only)
If Len(tdfTable.Connect) > 0 Then
' Set the tables connection string
tdfTable.Connect = strConnect
' Refresh the link to the table
[highlight #F57900]tdfTable.RefreshLink[/highlight]
End If
Next
InitializeConnection = True
Exit Function
ErrorHandler:
MsgBox "RXP was unable to connect to the database", vbExclamation, "RXP - LOGIN"
InitializeConnection = False
End Function
Private Sub cmdCancel_Click()
CurrentDb.Close
Quit
End Sub
Private Sub cmdOk_Click()
Screen.MousePointer = 11
If ValidateInput() Then
If InitializeConnection() Then
DoCmd.Close acForm, "frmLogin"
End If
End If
Screen.MousePointer = 1
End Sub
Private Sub Form_Activate()
txtUsername.SetFocus
End Sub