DAO - Won't the function Close it? 
Author Message
 DAO - Won't the function Close it?

Whenever I need access to the DB, I create a private variable of  type
Database in a function and do the work.

But I never close it before I exit the Function assuming that all the
variables in that routine will be cleared when we exit the Function,

Is it true ? Is the way I am following correct?

Vee



Fri, 30 Nov 2001 03:00:00 GMT  
 DAO - Won't the function Close it?
most likely they will be, but for safety's sake, you should close them
manually.  (it's only one line of code)



Quote:
> Whenever I need access to the DB, I create a private variable of  type
> Database in a function and do the work.

> But I never close it before I exit the Function assuming that all the
> variables in that routine will be cleared when we exit the Function,

> Is it true ? Is the way I am following correct?

> Vee

--
Nick Hasser

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Fri, 30 Nov 2001 03:00:00 GMT  
 DAO - Won't the function Close it?
As long as the variable is defined as a local variable, and not global, it
will automatically close when you exit the function.

But, as Nick said, it's only one line of code...so why the heck not be
safe...

Manish


Quote:
> Whenever I need access to the DB, I create a private variable of  type
> Database in a function and do the work.

> But I never close it before I exit the Function assuming that all the
> variables in that routine will be cleared when we exit the Function,

> Is it true ? Is the way I am following correct?

> Vee



Fri, 30 Nov 2001 03:00:00 GMT  
 DAO - Won't the function Close it?

says...
Quote:
> Whenever I need access to the DB, I create a private variable of  type
> Database in a function and do the work.

> But I never close it before I exit the Function assuming that all the
> variables in that routine will be cleared when we exit the Function,

> Is it true ? Is the way I am following correct?

> Vee

 In my knowledge, yes!

--------------------------------
Drazen Ljubic
software engineer



Sat, 01 Dec 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Access97 won't close after running DAO code

2. Tip : VB.NET Form Won't Close on Me.Close + User Controls

3. Access '97 won't close

4. Two Q's [Closing a file][why won't work]

5. Application written for Access 2000 with DAO won't run in Access 2002

6. HELP NEEDED: Access 95 DAO Error - Won't Start, Access Quits

7. Access won't start due to DAO

8. DAO Seek Example won't work

9. DAO 2.5 won't convert zero length string to null in date field

10. DAO 2.5 won't convert zero length string to null in date field

11. Won't register DAO on Setup problem

12. Won't register DAO on Setup problem

 

 
Powered by phpBB® Forum Software