newbie: deactivate query before freeing?



Do you have to deactivate a query before you free it? Does this
guarantee that the database server will close the connection or
something like that?
What about the use of try..finally? Is this necessary?

try
myQuery.Create(nil);
myQuery.sql.text := 'SELECT * from Blah';
myQuery.active := true;
...
finally
if assigned(myQuery) then
begin
myQuery.active := false;
freeAndNil(MyQuery);
end;

-Corinna

.



Relevant Pages

  • Re: server IP adress and port
    ... database server IP address ... I know of no query that will provide the Operating System Port number ... query unless you know the port number to use to make a connection so ...
    (comp.databases.oracle.server)
  • Re: ASP - FROM statement slows down connection to database
    ... Open your database in Access, switch to the Queries tab, create a new query ... in Design View without choosing a table, swtich to SQL View, paste the sql ... connection string rather than using an ... recordset open statements. ...
    (microsoft.public.inetserver.asp.db)
  • Re: Update checking
    ... My thought was to use a simple query with a "username" param ... concurrency exceptions happen if the data you queried has ... > was and basically let the user work in a similar offline mode. ... Where does connection pooling come ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: MS Access looks for .mdb rather than Progress schema
    ... # Same query previously worked in Progress 8.x using SQL89. ... This entry allows you to keep your existing code written with the ODBC ... BTW, if you put all of the connect information into the connect string, ... I also tried putting the whole thing in the connection string: ...
    (microsoft.public.access.modulesdaovba)
  • Re: OpenDataSource & stored procedure
    ... recognises the ODBC escape syntax. ... You shouldn't need the connection parameter since Word gets it from the ... return multiple result sets - enough to confuse software such as MS Query ... >>> The call works in MSQuery but won't return the data to Word. ...
    (microsoft.public.word.mailmerge.fields)