M
MichaelW.
I need to be able to push a button on an Excel Worksheet
and execute VB code that will retrieve data from a
SQLServer data base into an Excel Worksheet. The data
is "hourly" records and I will need to query and retrieve
the data for the current day. I have good programming
knowledge of Access and know how I would do this in Acess
but my Excel skills are limited.
I have sucessfully added a button to the worksheet that
executes VB code that connects to the SQL Server data
base using (ODBC data source) using the OpenConnection
method but I am not sure where to go from here.
Does anyone have a simple start to finish example of
connecting to a SQLServer data base and retrieiving into
Excel?
Thanks.
Oh, by the way I started out doing this using MSQuery and
successfully retrieved the data back into Excel for
a "hardcoded" date. However, I was not sure how to pass
MSQuery a paramter to retrieve the "current" date. From
this I decided I would rather use VB code instead of
MSQuery but maybe this is not the best approach.
Any advice? Maybe an even better way?
Thanks, again.
and execute VB code that will retrieve data from a
SQLServer data base into an Excel Worksheet. The data
is "hourly" records and I will need to query and retrieve
the data for the current day. I have good programming
knowledge of Access and know how I would do this in Acess
but my Excel skills are limited.
I have sucessfully added a button to the worksheet that
executes VB code that connects to the SQL Server data
base using (ODBC data source) using the OpenConnection
method but I am not sure where to go from here.
Does anyone have a simple start to finish example of
connecting to a SQLServer data base and retrieiving into
Excel?
Thanks.
Oh, by the way I started out doing this using MSQuery and
successfully retrieved the data back into Excel for
a "hardcoded" date. However, I was not sure how to pass
MSQuery a paramter to retrieve the "current" date. From
this I decided I would rather use VB code instead of
MSQuery but maybe this is not the best approach.
Any advice? Maybe an even better way?
Thanks, again.