Re: Test If a DB Is Open

From: Eddie's Bakery and Cafe' (eytchisoneb_at_hotmail.com)
Date: 03/12/05


Date: Sat, 12 Mar 2005 08:41:03 -0800

Hi Nick, Thanks for the response and suggestions, I am doing everything you
suggested, except think I am creating a new connection every time I enter the
sub. Below is a snapshot of my code:

Public Sub myDBMgr (...)
  Dim cnn As ADODB.Connection
  Dim rs As ADODB.Recordset
  ...
  Set cnn New ADODB.Connection
  Set rs = New ADODB.Recordset
  ...
  cnn.Open strCnn
  rs.Open strSQL, cnn
  ...
  rs.Close
  Set rs = Nothing
  cnn.Close
  Set cnn = Nothing
End Sub

Thanks for help,

Eddie

"Nick Coe (UK)" wrote:

> In news:CB02A104-6067-474F-8064-97B65A6EF8C3@microsoft.com,
> Eddie's Bakery and Cafe' typed:
> > Hi Nick, Thanks for the info. Is there anyway of getting
> > around this
> > problem. Because every time I run my program (via
> > switching to
> > "Form-View") after making software changes, I get this
> > error.
> > Currently, I have to make my software changes, kill the VB
> > Editor,
> > Kill the Form and re-open the form to run the program.
> > There has to
> > be a better way of developing code.
> >
> > Thanks, Eddie
> >
>
> Eddie,
>
> That's a new one on me. Are you absolutely _certain_ that
> all objects that were open in design view are now closed?
>
> Sometimes the VBA editor will open umpteen windows all by
> itself (actually it depends what you were doing when you
> closed it, but I hate that kind of assumptive behaviour) and
> you won't notice because they're hidden behind the one
> you're working on.
>
> Could be a persistant lock in the applications' LDB file.
> Close your app and Access, double check it _is_ closed and
> then look in your app folder for a file with the same name
> as your app and the suffix .ldb. If it exists delete it.
> Don't do this with your db open!
>
> Double check your options, make certain you've got your app
> set to share.
>
> When you set connection are you using
> CurrentProject.Connection or creating a new connection?
> Wouldn't have thought it was an issue but I've always used
> CurrentProject.Connection or CodeProject.Connection, it's a
> lot easier.
>
> Make sure you close connections and recordsets and set to
> Nothing when done with.
>
> Can't think of anything else at the moment...
>
> --
> Nick Coe (UK)
> AccHelp v1.01 Access Application Help File Builder
> http://www.alphacos.co.uk/ Download Free Demo Copy
>
>
>



Relevant Pages

  • Re: Test If a DB Is Open
    ... > Hi Nick, Thanks for the info. ... Could be a persistant lock in the applications' LDB file. ... then look in your app folder for a file with the same name ... CurrentProject.Connection or creating a new connection? ...
    (microsoft.public.access.modulesdaovba)
  • Re: Correction
    ... Nick only gave his opinion ... :>>> the connection to the ISP to enable removing QoS." ... disallow each and every port with Windows Firewall? ...
    (microsoft.public.windowsxp.messenger)
  • Re: SQL statement to merge access tables
    ... Dim CNN As Connection ... Set CNN = New Connection ... 'Establish a connection to the Destination database ...
    (microsoft.public.vb.general.discussion)
  • RE: Media Centers Automatic Log-On!
    ... "Amar" wrote: ... >> nor have the need for this program data list. ... >> and only via my default connection, has not worked; ...
    (microsoft.public.windows.mediacenter)
  • Re: I like Ann Coulter
    ... warrants the connection you're attempting to make. ... We are a visual species over everything else! ... That is why such as Veronica Lake lost ... That is why Nick et. ...
    (misc.news.internet.discuss)