The following code works when employed on Windows XP clients. I am upgrading to Windows 7 Professional 64 bit. I have verified the ODBC connection is working properly through the ODBC management.
I get Error 3151
Private Sub Form_Load()
Dim DB As DAO.Database
Dim TDF As DAO.TableDef
'Refresh Databse Link
Set DB = CurrentDb()
Set TDF = DB.TableDefs("EWVPD_PRODUCT")
TDF.Connect = "ODBC;DSN=[DSN_NAME];UID=[USER];PWD=[Password]"
TDF.RefreshLink
DoCmd.OpenForm "Main", acNormal
DoCmd.Close acForm, Me.Name
End Sub
Error Message:
Run-time error '3151'
ODBC connection to '[DSN_NAME] failed
The code in RED is being flagged for the error.
The file's location is in the trusted locations via registry edits.
The idea of this code is to make a connection to the Oracle database in the background when the application opens to avoid password issues.
Any advice on the configuration or re-coding of this is greatly appreciated. I suspect I will have to add code to compare the host operating system so I use the proper method depending on the client using the application.
I get Error 3151
Private Sub Form_Load()
Dim DB As DAO.Database
Dim TDF As DAO.TableDef
'Refresh Databse Link
Set DB = CurrentDb()
Set TDF = DB.TableDefs("EWVPD_PRODUCT")
TDF.Connect = "ODBC;DSN=[DSN_NAME];UID=[USER];PWD=[Password]"
TDF.RefreshLink
DoCmd.OpenForm "Main", acNormal
DoCmd.Close acForm, Me.Name
End Sub
Error Message:
Run-time error '3151'
ODBC connection to '[DSN_NAME] failed
The code in RED is being flagged for the error.
The file's location is in the trusted locations via registry edits.
The idea of this code is to make a connection to the Oracle database in the background when the application opens to avoid password issues.
Any advice on the configuration or re-coding of this is greatly appreciated. I suspect I will have to add code to compare the host operating system so I use the proper method depending on the client using the application.
Last edited: