joemeshuggah
Board Regular
- Joined
- Jul 18, 2008
- Messages
- 161
i have an access database set up to run a number of passthrough queries via macro. to avoid having to constantly enter user ID and password, i set up the ODBC Connect Str in the property sheet of each passthrough query to include my user ID and password.
this works fine, but when it comes time to update my password, i ultimately have to go into each passthrough property sheet and update the connection string with my new password. i was hoping to get around this by using a variable...so i entered the following into the ODBC Connect Str box in the property sheet of each passthrough:
ODBC;DSN=MyDataBase;UID=StrUser;PWD=StrPass;DATABASE=MyDataBase;
i then created a form with a button that has the following for the even procedure
Private Sub cmdRunMacro_Click()
Dim StrUser As String
Dim StrPass As String
StrUser = InputBox("Enter User ID")
StrPass = InputBox("Enter Password")
DoCmd.RunMacro "DataBaseUpdate"
End Sub
the connection fails...is there something i am missing?
oddly, if change just one of the passthrough connection strings to include my actual user id and password, run it, then change it back to the variable strings & re-run the macro, the macro completes successfully.
this works fine, but when it comes time to update my password, i ultimately have to go into each passthrough property sheet and update the connection string with my new password. i was hoping to get around this by using a variable...so i entered the following into the ODBC Connect Str box in the property sheet of each passthrough:
ODBC;DSN=MyDataBase;UID=StrUser;PWD=StrPass;DATABASE=MyDataBase;
i then created a form with a button that has the following for the even procedure
Private Sub cmdRunMacro_Click()
Dim StrUser As String
Dim StrPass As String
StrUser = InputBox("Enter User ID")
StrPass = InputBox("Enter Password")
DoCmd.RunMacro "DataBaseUpdate"
End Sub
the connection fails...is there something i am missing?
oddly, if change just one of the passthrough connection strings to include my actual user id and password, run it, then change it back to the variable strings & re-run the macro, the macro completes successfully.