Query on Record Number

I want to pull out a selection data but only within a range of record numbers.  e.g. record numbers 1-100  How do I do this without having a number field.  Can I do it just by record number?  Normally I would have my query which has between.... and.... in the criteria, but how do I refer to the record number rather than a field name?
PowerhousecomputingAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Heathcliff74Commented:
MS Access does not allow selection on recordnumbers. It only allows you to select on an auto-increase-field, but I guess that is not what you mean. However, through ADO-recordsets it is possible to use paging. Here is some sample vb-code:

iPageSize = 100
strPageCurrent = 1 ' Select the first page

'Open the connection string
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstring

set cmd = server.CreateObject("adodb.command")

set cmd.ActiveConnection = conn

'set sql statement to a local variable
strSql = "SELECT * FROM table1"


With cmd
    .CommandType = adCmdText
    .CommandText = strSQL
End With

Set rs = Server.CreateObject("ADODB.Recordset")

' Set cursor location and pagesize
rs.CursorLocation = adUseClient
rs.PageSize = iPageSize

' Open Recordset object and
rs.Open cmd

'Disconnect from database
cmd.ActiveConnection = nothing

' Get the count of the pages using the given page size
strPageCount = rs.PageCount

' If the request page falls outside the range,
' give them the closest match (1 or max)
If 1 > strPageCurrent Then strPageCurrent = 1
If strPageCurrent > strPageCount Then strPageCurrent = strPageCount

' Move to the selected page
rs.AbsolutePage = strPageCurrent
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.