Results 1 to 4 of 4

Thread: General data question

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    London, UK
    Posts
    11

    Question 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

  2. #2
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    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
    -= a peet post =-

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2001
    Location
    London, UK
    Posts
    11
    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

  4. #4
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    yes... I think...
    -= a peet post =-

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width