PDA

Click to See Complete Forum and Search --> : a question of efficiency


Jan 25th, 2000, 05:35 AM
which is the most efficient?

to keep opening and then closing
workspaces and database object variables
within procedures or..

to keep them open
with different variables?

andymac
Jan 25th, 2000, 06:04 AM
Keep them open using just one variable. Just make sure the scope is what you want. I ususally have a module / class that has a module level (i.e., Dimmed in the declarations section) of the database connection, i.e., the actual database. Then when I want to use it, from a function within the scope, i.e., in that module / class, just create a local instance of say a recordset and just use that.

That way you only need to open the connection once (which for something like Oracle) can take a noticable time.

Hope this helps

cheers

Andy