Galviniser
New Member
- Joined
- May 31, 2019
- Messages
- 3
Hi,
Straight to the point but here is the code
Basically this works, however instead of it pulling from: (sheet name)WWALMDB i would like it to pull from WWALMDB(sheet name)
So when i tried this code:
It did not work, i am getting an error saying:
(There has been an error during refresh: -2147217843 Login failed for user 'SA'.)
i have tried different variations of the code from putting the "ActiveSheet.Name" in different places
It also works if you type WWALMDB_Sheet1 where Sheet1 is the name of the sheet. But i would like it to automatically do it depending on the sheet name, not have to change the code every time.
I hope there is enough info here
Regards
Chris
Straight to the point but here is the code
Code:
stADO = "Provider=SQLOLEDB;Data Source=UKD1-ENG-01;Initial Catalog=" & ActiveSheet.Name & "WWALMDB;User ID=SA;Password=*****"
Basically this works, however instead of it pulling from: (sheet name)WWALMDB i would like it to pull from WWALMDB(sheet name)
So when i tried this code:
Code:
stADO = "Provider=SQLOLEDB;Data Source=UKD1-ENG-01;Initial Catalog=" & "WWALMDB;User ID=SA;Password=*****" & ActiveSheet.Name
It did not work, i am getting an error saying:
(There has been an error during refresh: -2147217843 Login failed for user 'SA'.)
i have tried different variations of the code from putting the "ActiveSheet.Name" in different places
It also works if you type WWALMDB_Sheet1 where Sheet1 is the name of the sheet. But i would like it to automatically do it depending on the sheet name, not have to change the code every time.
I hope there is enough info here
Regards
Chris