Results 1 to 11 of 11

Thread: Inline Code/Class Question [Resolved]

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2005
    Posts
    116

    Resolved Inline Code/Class Question [Resolved]

    Hi,

    I'm creating a database application, which connects to a database and performs different queries on different forms. I've designed it two different ways:
    1. Using code in each form to make a new connection and then doing the query with that
    2. Using a class for the connection, and creating a global instance of it in a module, so that the connection is made when the application loads and the recordset is accessed by various Property Get statements.

    Which do you think is better programming practice? Generally, we're encouraged not to use global declarations, but this is an object, so I'm not sure if that's okay. Also, with the class, if I need to retrieve some information from a separate table (e.g. I have an ID number from one table, and I need to match that to a name from another), then I either have to store the orginal query and query again at the end of retrieving the new information, or create a new instance of the class.

    If this is unclear, and you want some code, just ask.
    Last edited by olamm2k; Feb 26th, 2005 at 03:37 PM.

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