I have a database that was created around 15 years ago. Back then, a number of the linked ODBC tables were called other things and required different IDs and passwords in order to connect to them.
One of the users here was getting an error message when they try to run a select query against two of these tables (which was how I started investigating and found out about the whole ID and password change thing). The message is as follows:
Clicking directly on either of the tables in the select query also informed me that "XXXXX" did not have adequate permissions.
1. I changed all references in the VB and queries, to refer to the new tables and not the old
2. I changed a section of code that runs when the database opens, from
to
Where the XXXXX,YYYYY, AAAAA and BBBBB are valid IDs and passwords.
3. I created a new link to the ODBC database, using the new ID and password, overwriting the old one.
4. I deleted all linked ODBC tables and reconnected using the new ID and password combination. Also removing the tables whose names have changed and replacing them with links to the new, relevant ones (checking that table structure hasn't altered)
5. I saved, closed and reopened the database
When I click directly on the tables in question, they now open without any problems. or error messages However, when I run the original, problematic query, I still get exactly the same error message as I did originally.
Looking in table MSysQueries, I can confirm that the connection string used when the query was run did include the old ID.
I'm relatively new to ODBC connections from Access, so I apologise if this is a really basic concept, but I can't work out where the query is still picking up the old ID from?
One of the users here was getting an error message when they try to run a select query against two of these tables (which was how I started investigating and found out about the whole ID and password change thing). The message is as follows:
Code:
Run-time error '3146':
ODBC-Call failed.
[IBM][CLI Driver][DB2/LINUXX8664] SQL0551N "XXXXX" does not have the privilege to perform operation "SELECT" on object {tablename}. SQLSTATE = 42501 (#-551)
1. I changed all references in the VB and queries, to refer to the new tables and not the old
2. I changed a section of code that runs when the database opens, from
Code:
'Set db = OpenDatabase("", False, False, _
' "ODBC;DSN=TRGTPRD2;" & _
' "UID=XXXXX;PWD=YYYYYY;DATABASE=TRGTPRD2;")
Code:
'Set db = OpenDatabase("", False, False, _
' "ODBC;DSN=TRGTPRD2;" & _
' "UID=AAAAAA;PWD=BBBBB;DATABASE=TRGTPRD2;")
3. I created a new link to the ODBC database, using the new ID and password, overwriting the old one.
4. I deleted all linked ODBC tables and reconnected using the new ID and password combination. Also removing the tables whose names have changed and replacing them with links to the new, relevant ones (checking that table structure hasn't altered)
5. I saved, closed and reopened the database
When I click directly on the tables in question, they now open without any problems. or error messages However, when I run the original, problematic query, I still get exactly the same error message as I did originally.
Looking in table MSysQueries, I can confirm that the connection string used when the query was run did include the old ID.
I'm relatively new to ODBC connections from Access, so I apologise if this is a really basic concept, but I can't work out where the query is still picking up the old ID from?