Need help to prepare a vba code

New Contributor


MS Access Database - ABC

Query - Data


i just wanted to code

to open the ABC database and click on query Data.

when i open query it ask for servername , login, password (pass thru)

Once parameter is updated, i get a view of table with data

i just wanted to copy the data.


Please help me with the code as i tried but unable to go past the login password 



1 Reply

@gilbert7 Based on your description, one assumes that this is an Access accdb linked to tables in SQL Server, SQL Azure, or perhaps another server-based database.


In all of those cases, you need to correct ODBC Driver, the name of the server on which the database resides, the name of the database, and a valid login and valid password. PLUS the owner of that database must have given you permissions to use it. One assumes that, if you have a valid login and password, the DBA has given you appropriate permissions.


What part of this is failing for you, specifically?