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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DB connection

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have about 200 user records that I need to access by user. Each user will have about 10 records each, so that means I'll have about 20 users. I see three different options.
1. Do I open a record set with all 200 records and leave it open, using rs.movefirst to cycle through the data 20 times.
2. Do i filter the request per user, making 20 calls to the DB each bringing in 10 records.
3. Do i hit the database just once, and bring in all 200 records into an array. close my connection and then just work with the array.
Any help would be apreciatied.
Thanks
 
Im new here, and dont know much about programming with databases(although I am learning alot.) but I would go with option number 2. Just filter out the database on a use basis.
 
It depends on what you are needing. If this is a case where you will only need to display 1 user set at a time, I would go with option 2. This way, even though you will be making multiple calls, if your displaying them i user set per page, then in the long run it will be less work for your server to pull them out on a user by user basis.
If your planning on displaying information relative to all 200 records on a single page, I would pull all of the records out, sorted by user. This way you have all 200 of your records grouped together in your recordset by users.
If you want to perovide a little more information on what your trying to accomplish, I'm sure we could give you much more specific advice.
-Tarwn ------------ My Little Dictionary ---------
Extreme Programming - (1)Trying to code before my second cup of coffee. (2) While(1){ Ctrl+C; Ctrl+V; }
FAQ - Web-ese for "Forget Asking Questions, I am to busy" :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top