1,105,371 Community Members

Restrict number of customer from database

Member Avatar
Sturdy
Light Poster
39 posts since Mar 2011
Reputation Points: 11 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi All,

How i can restrict the numbers of customer from database?
I use adodb with access.
I know how to retrieve customers from database but i don't know how to restrict it to spesific numbers.

Best Regards.
Sturdy

Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
0
 

Can you show your sql query to retrieve customers from database?

Member Avatar
Sturdy
Light Poster
39 posts since Mar 2011
Reputation Points: 11 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Yes, this my query to retrieve data :

Dim rs As New ADODB.Recordset
rs.Open "SELECT * from Customers", Conn,adOpenStatic ,adLockOptimistic 

However, i want to restrict all data to recordset is just only 50 customers.
How i can do this? Please help.

Member Avatar
Jx_Man
Senior Poster
3,543 posts since Nov 2007
Reputation Points: 987 [?]
Q&As Helped to Solve: 542 [?]
Skill Endorsements: 74 [?]
Featured
 
1
 

To limit your retrieved data from database you use TOP clause in your sql statement.
You can read in this site.

Select TOP 50 * from Customers
Member Avatar
Sturdy
Light Poster
39 posts since Mar 2011
Reputation Points: 11 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Wow...That code worked perfectly.
Thank you sir.

Question Answered as of 2 Years Ago by Jx_Man
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: