Question on Select Query

D

Dotnetjunky

Hi,

I want to perform paging in my .NET application, which use Access as the
backing store. So, I create a Select Query similar to this:

Parameters PageSize Short, LastRecordId Long;
Select Top PageSize ......

However, Access throws an error saying that the syntax is incorrect. If I
change it to:

Select Top 10 ....

then, there's no error at all. Anybody knows why ?

Thanks.
 
V

Van T. Dinh

Just to clarify: the TOP value canNOT be a Parameter. It must be an
explicit number in the SQL String.

That points to one solution which is to construct your SQL String on the go
and use the SQL String rather than the Query.
 
Top