VidyaKruthi
New Member
- Joined
- Feb 17, 2012
- Messages
- 18
Hi All Good Evening,
Please help me out how to connect to SQL Server and get data using VBA.
Please help me out how to connect to SQL Server and get data using VBA.
It has taken me ages to find a straightforward example like this to work from.
How do add the server username and password, I'm guessing it's this line:
"Integrated Security=SSPI;"
It has taken me ages to find a straightforward example like this to work from.
How do add the server username and password, I'm guessing it's this line:
"Integrated Security=SSPI;"
This connection string includes the User ID and Password.
Code:'Open Connection' objMyConn.ConnectionString = "Provider=IBMDA400;Data Source=YourSource;User Id=YourUserName;Password=YourPassword;Force Translate = 0;" objMyConn.Open
You will need to modify the Provider, Data Source, User ID and Password values.