|
-
Nov 7th, 2001, 08:08 AM
#1
Thread Starter
New Member
General data question
Hi,
Sorry if this sounds odd, or goes on a bit, but I've got a question that I'd really appreciate any help anyone can give.
I'm writing an app that has a number of forms, a couple of which depend on having access to the same data table (Access 200, for the moment).
Basically, I can open a connection to a connection object & recordset at form.load time, but there will come a point where due to the nature of vb's "loads of things can happen at once" style of programming, two procedures could be accessing the same "public" recordset at the same time.
This could cause some confusion and perhaps loss of data integrity. Is it usual for each procedure within a "data enabled" app to create and then destroy it's own connection or recordset objects - or is it more usual for a global module or class module to manage data access to a shared table?
I hope someone out there can get where I'm coming from - I'm really after a few pointers I guess!
Anyway, thanks for taking the time to read this - and if you have any comments, please respond!
Many thanks,
Tarique
-
Nov 7th, 2001, 08:12 AM
#2
-= B u g S l a y e r =-
Global recsets and db objects are a no no methink.
use classes, open the connection, read data into private vars within the class objec. Close the connection
when saving, do it the other way around
-
Nov 7th, 2001, 08:36 AM
#3
Thread Starter
New Member
Gotcha (I think!)
So if I use class libraries for data, I can basically set an object in a procedure to be or type "data.class" (for want of a better phrase!) and then it operates independantly of the other processes, in effect keeping a copy of it's own data objects, whilst pushing the data handling procedures onto the class library.
I'll give it a go - thanks a lot for the quick n helpful response!
Many thanks,
Tarique
-
Nov 7th, 2001, 09:15 AM
#4
-= B u g S l a y e r =-
yes... I think...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|