Database calls within functions

Results 1 to 2 of 2

Thread: Database calls within functions

  1. #1
    Join Date
    Dec 1969

    Default Database calls within functions

    Hello,<BR><BR>I was wondering how best to deal with this....<BR><BR>If I have a function that needs to hit a database. Say it&#039;s called GetUserEmail() which accepts a user_id and returns the email address from a database.<BR><BR>What is the best way to deal with the database connection? To date, I&#039;ve written procedures that assume a connection and recordset object exist and are initialized, so I just do a objRS.Open within the procedure. Is it better to declare a new database connection and/or recordset within the procedure, or is what I&#039;m doing ok?<BR><BR>- Chuck

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default You CAN declare a recordset object

    if you want<BR><BR>but do not create a new connection. Use the one that exists on your page<BR><BR>

Posting Permissions

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