Where Clause with the OpenReport command

  • Thread starter Thread starter eighthman11
  • Start date Start date
E

eighthman11

Hello everyone,

On Access 2000 - Sql Server 2008,

Quick question. Lets say you create a View on the Sql Server and link
it to your Access Database. Then use that View for the data source of
a report.

If you send a "where clause" for your OpenReport command will that
cause the View to only return data based on the "where Clause" so only
that specific data comes down the pipe?

Or will the entire View execute and all the data come down the pipe
and the "where clause" will only filter the records you see on the
report?

Any help appreciated. Thanks Ray
 
Or will the entire View execute and all the data come down the pipe
and the "where clause" will only filter the records you see on the
report?

Any help appreciated. Thanks Ray


You'll only get the records to come down the pipe that meet the criteria you
specified. (so no not all the data will come down the pipe).

In fact even in the case when using MS access without SQL server and using a
standard jet based file share back end (mdb file), the where clause will
restrict the records that come down across the network to only those that
meet the criteria.

What this means that using SQL server, using sql views, or even using a jet
based back end, only the records that meet the criteria come across a
network.

To expand on this a bit furhter, while both SQL server and a a file share
only drag records that meet the criteria, in the case of an index not being
able to be used then JET will drag the whole table, but sql server will
STILL ONLY drag the records that meet the criteria down the pipe.

So the answers is in the case of SQL server or even when you don't use SQL
server and use a jet based mdb file share for the back end, only the records
that meet the criteria are dragged across the network. (the exception being
when jet can not use an index for a file share).
 
Back
Top