🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2115

Re: New problem with ADO & Access

#2115
From: Vladimir Afanasyev
Date: Fri, 07 Nov 2003 08:10
53 lines
2862 bytes
Hi Ted,

"Ted Byers" <r.ted.byers@sympatico.ca> wrote:
>
>Hi Vladimir,
>
>What about my guess is this function:
>
>    void Disconnect(void) {
>      if (connected) {
>        connection.Exec(Function("Close"));
>        // is the following necesary - I doubt it (because
>        // of the bad effect of connecting to a DB with
>        // both the catalog and connection objects)
>        // but I want to be sure
>        catalog.Exec(Function("Close"));
>        connected = false;
>      }
>    };
>
>Is it right or wrong to call close on catalog if it has already been called
>on connection?

"Close" - is not property for Catalog object.

By definition method Create (Catalog) - creates and opens new 
connection (ActiveConnection property). But not every provider 
support creating new Catalog. So it is possible to call Create 
for Catalog then test Errors collection (Error object from ADO) 
and if all good use ActiveConnection else to use Open method from 
Connection object. 

    void Disconnect(void) {
      if (connected) {
        connection.Exec(Function("Close"));

// also possible :
        connection=Unassigned;
        catalog=Unassigned;
// now you can use VarIsEmpty(connection) or VarIsEmpty(catalog)
// for testing before using.

        connected = false;
      }
   };

By the way. Now I think about article for my site (automating 
for Microsoft Project). Can I ask you to read it and make your 
notes when it will be ready?

Best Regards,
Vladimir.
Technical Details
Message-ID: <3fab6179$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!news-out.superfeed.net!propagator2-maxim!news-in-maxim.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3fa6811e$1@newsgroups.borland.com> <3fa77c01$1@newsgroups.borland.com> <3fa7ac8a$3@newsgroups.borland.com> <3fa7ea09$1@newsgroups.borland.com> <3fa7fe9b$1@newsgroups.borland.com> <3fa8e7b7$1@newsgroups.borland.com> <3fa960f8$1@newsgroups.borland.com> <3faa750f$1@newsgroups.borland.com> <3faa88cd$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,f2b48c4b0b8a3004
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-07 01:25:48 PST
From: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Sender: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Reply-To: "Vladimir Afanasyev" <avv@systema.kiev.ua>
Subject: Re: New problem with ADO & Access
Newsgroups: borland.public.cppbuilder.database.ado
X-User-Info: 212.82.216.226     
X-Forwarded-For: 192.168.0.147
References:  <3fa6811e$1@newsgroups.borland.com> <3fa77c01$1@newsgroups.borland.com> <3fa7ac8a$3@newsgroups.borland.com> <3fa7ea09$1@newsgroups.borland.com> <3fa7fe9b$1@newsgroups.borland.com> <3fa8e7b7$1@newsgroups.borland.com> <3fa960f8$1@newsgroups.borland.com> <3faa750f$1@newsgroups.borland.com> <3faa88cd$1@newsgroups.borland.com>
NNTP-Posting-Host: 207.105.83.66
Message-ID: <3fab6179$1@newsgroups.borland.com>
Date: 7 Nov 2003 01:10:17 -0700
X-Trace: newsgroups.borland.com 1068196217 207.105.83.66 (7 Nov 2003 01:10:17 -0700)
Lines: 53
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!news-out.superfeed.net!propagator2-maxim!news-in-maxim.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail