Question on Select Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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.
 
Back
Top