ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   recordset vs collection (https://www.excelbanter.com/excel-programming/449809-recordset-vs-collection.html)

Keith Willis

recordset vs collection
 
Hi all

I'm developing a project thats going to be a excel front end to a SQL db. One part of the required functionality is that you performa a search on the database and return possibly mutliple records for review or amendment on a userform. Normally i read data from a recordset into a collection so i'm not constantly requerying the db, but it's occoured to me for this that if i use a collection and close the recordset then it';s concievably possible that another user might access one of the already open records and change the data leading to a concurrancy problem. Would using a recordset to return the results and use as the source for the data displayed in the form solve this problem?

Thanks

Keith

Abhijeet Gudur

recordset vs collection
 
Only if same record is accessed by multiple users,there is a chance it will error.
You can introduce a key field and for records in review you can tick them while it's open. If record is ticked no other user can modify the records,but view is closed key field can be unchecked.

On Thursday, 13 February 2014 16:07:13 UTC+5:30, Keith Willis wrote:
Hi all I'm developing a project thats going to be a excel front end to a SQL db. One part of the required functionality is that you performa a search on the database and return possibly mutliple records for review or amendment on a userform. Normally i read data from a recordset into a collection so i'm not constantly requerying the db, but it's occoured to me for this that if i use a collection and close the recordset then it';s concievably possible that another user might access one of the already open records and change the data leading to a concurrancy problem. Would using a recordset to return the results and use as the source for the data displayed in the form solve this problem? Thanks Keith



GS[_2_]

recordset vs collection
 
Adding the extra overhead by loading a recordset into a collection
isn't very practical, IMO, because you can manipulate the recordset
much easier via ADO. Kind of makes the extra step to populate a
collection a waste of time/resources. My point assumes you use ADO to
read/write the data in the SQL db!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion




All times are GMT +1. The time now is 10:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com