I would like to create a link from an SQL Server database to an MS Access database for reporting purposes. I don't need all the data from the table just the past few years worth. Is there a way through Access VBA or MS Access tools to only bring in the rows I need rather then all rows?
Link SQL Server data to MS Access database with filters
1.1k views Asked by AudioBubble At
3
There are 3 answers
0
On
This is an example of how a parameter table works in SQL Server, that can easily be updated from Access. The table is updated or inserted with the current username and the filter value, changing the rows returned by the view.
create table Params (
usrname as nvarchar(100) CONSTRAINT [df_load_date] DEFAULT @@SUSER_NAME
, pvalue as nvarchar(100))
Insert into params (pvalue) values ( 'MytableName')
Create view vw_test
as
select * from sysobjects where name in (
Select pvalue from Params where usrname = @@SUSER_NAME)
I talked to our DBA. I'm going to create a view. cloudsafe thanks for the suggestion, I just didn't have the time to investigate QueryDef in Access, but I've I made a note of it for possibly future usage.