Advice: closing objects after query in Access DB
From: rotor (anonymous_at_discussions.microsoft.com)
Date: 05/13/04
- Next message: Gaidheil: "Re: DataAdpter Update fail on Child table"
- Previous message: Kevin Burotn: "Replication notification."
- Next in thread: Val Mazur: "Re: Advice: closing objects after query in Access DB"
- Reply: Val Mazur: "Re: Advice: closing objects after query in Access DB"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 May 2004 07:01:08 -0700
Hello, I'm using VBA, ADO in Access 2002.
I have a function that I can call on the fly that takes a SQL argument and then executes an ADO query. This function then returns an ADO recordset to the calling subroutine.
I really like this functionality and it works great, BUT I can't close the connection in the usual manner inside the function because the function actually returns the recordset.
1. Does this hurt anything since the connection is never closed, or does it matter? Does the connection persist after the RS is passed on to another subroutine?
2. If this is not a good thing, how can I close the connection and keep the recordset?
3. Because the recordset is passed on, that is not closed in the source function either. Does this matter?
I really do not want to restructure my functions, work arounds? Please advise on this. Thanks much in advance.
- Next message: Gaidheil: "Re: DataAdpter Update fail on Child table"
- Previous message: Kevin Burotn: "Replication notification."
- Next in thread: Val Mazur: "Re: Advice: closing objects after query in Access DB"
- Reply: Val Mazur: "Re: Advice: closing objects after query in Access DB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|