Hello,
I have a VBA code to an SQL query with the following connection string (part of VBA):
With ActiveWorkbook.Connections("Data").OLEDBConnection
.BackgroundQuery = False
.CommandType = xlCmdSql
.connection = _
"OLEDB;Provider=SQLOLEDB.1;Password=PASSWORD;Persist Security Info=True;User ID=ADUSER;Data Source=SQLSERVER1;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False;Initial Catalog=DATABASE1"
I know we all can access to this SQL using the password and user name (as read only access), but for some reason when I run this VBA from another computer it is not being ran. What could be the reason?
I am using this connection string syntax based on manually recorded macro from my computer. I had to remove the workstatation ID from connection string, I thought this would work from other computers. But data is not being retrieved and I'm not getting an error message.
I have a VBA code to an SQL query with the following connection string (part of VBA):
With ActiveWorkbook.Connections("Data").OLEDBConnection
.BackgroundQuery = False
.CommandType = xlCmdSql
.connection = _
"OLEDB;Provider=SQLOLEDB.1;Password=PASSWORD;Persist Security Info=True;User ID=ADUSER;Data Source=SQLSERVER1;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=False;Initial Catalog=DATABASE1"
I know we all can access to this SQL using the password and user name (as read only access), but for some reason when I run this VBA from another computer it is not being ran. What could be the reason?
I am using this connection string syntax based on manually recorded macro from my computer. I had to remove the workstatation ID from connection string, I thought this would work from other computers. But data is not being retrieved and I'm not getting an error message.