I am confused on how to set up my credentials in order to connect and extract data from MS SQL Server using Excel VBA. I know this is possible with an ADO connection, I am not sure of how to setup my code to access my sql database.
Can someone please send me a simple code to access my SQL database and place the information in cell "A1"?
Here are my credentials and SQL statement:
Server Name: dol-sql\sqldatabase
Database: test
Username: john
Password: smith
SQL:
Select GL_Balance.Fiscal_Year, GL_Balance.Main_Account, GL_Balance.Sub_Account,
Sum(GL_Balance.Year_Start_Value)
From GL_Balance
Group By GL_Balance.Fiscal_Year, GL_Balance.Main_Account, GL_Balance.Sub_Account
Order By GL_Balance.Fiscal_Year, GL_Balance.Main_Account, GL_Balance.Sub_Account
Thanks!
Can someone please send me a simple code to access my SQL database and place the information in cell "A1"?
Here are my credentials and SQL statement:
Server Name: dol-sql\sqldatabase
Database: test
Username: john
Password: smith
SQL:
Select GL_Balance.Fiscal_Year, GL_Balance.Main_Account, GL_Balance.Sub_Account,
Sum(GL_Balance.Year_Start_Value)
From GL_Balance
Group By GL_Balance.Fiscal_Year, GL_Balance.Main_Account, GL_Balance.Sub_Account
Order By GL_Balance.Fiscal_Year, GL_Balance.Main_Account, GL_Balance.Sub_Account
Thanks!