Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HOW CAN I RETURN IN A DATA BASE???

Status
Not open for further replies.

vivis

IS-IT--Management
Oct 1, 2002
17
0
0
MX
HI! I DID A SCRIPT THAT OPEN AN ACCES DATABASE AND I CAN READ THE INFORMATION IN THE DATABASE, WITH " .MOVENEXT" BUT I WANT TO KNOW HOW CAN I RETURN TO THE BEGINNING OF THE DATA ONCE I READ THE LAST FIELD. I TRIED TO USE THE ".CURSORLOCATION" BUT IT FAILED. SO I REALLY APRECIATE IF SOMEONE COULD HELP ME. THANX A LOT!!!
 
I'm not sure if this is what you need..

You can be sure to include an ORDER BY statement in your Sql sting:

theSql = "Select * FROM TABLE ORDER BY ID"

by default Access creates a primary key that is an auto number so the oldest record would appear. You can sort your records ascending or descending by adding ASC (ascending) or DESC (descending):

theSql = "Select * FROM TABLE ORDER BY ID ASC"
theSql = "Select * FROM TABLE ORDER BY ID DESC"

Hope this helped.. I'm not sure I unstood your question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top