PC Review


Reply
Thread Tools Rate Thread

Check if ADO connection open

 
 
=?Utf-8?B?Q2xheW1hbg==?=
Guest
Posts: n/a
 
      1st Aug 2007
Is there a way to check if an ADO connection is open in VBA? I'm currently
using:

If VacConn.Open Then VacConn.Close

assuming, wrongly of course, that the ADODB Connection Open method would
return a boolean...
--
Adios,
Clay Harryman
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VmVyZ2VsIEFkcmlhbm8=?=
Guest
Posts: n/a
 
      1st Aug 2007
Clay,

Try:

If VacConn.State = adStateOpen Then VacConn.Close


--
Hope that helps.

Vergel Adriano


"Clayman" wrote:

> Is there a way to check if an ADO connection is open in VBA? I'm currently
> using:
>
> If VacConn.Open Then VacConn.Close
>
> assuming, wrongly of course, that the ADODB Connection Open method would
> return a boolean...
> --
> Adios,
> Clay Harryman

 
Reply With Quote
 
=?Utf-8?B?Q2xheW1hbg==?=
Guest
Posts: n/a
 
      1st Aug 2007
Thank you! That did the trick.
--
Adios,
Clay Harryman


"Vergel Adriano" wrote:

> Clay,
>
> Try:
>
> If VacConn.State = adStateOpen Then VacConn.Close
>
>
> --
> Hope that helps.
>
> Vergel Adriano
>
>
> "Clayman" wrote:
>
> > Is there a way to check if an ADO connection is open in VBA? I'm currently
> > using:
> >
> > If VacConn.Open Then VacConn.Close
> >
> > assuming, wrongly of course, that the ADODB Connection Open method would
> > return a boolean...
> > --
> > Adios,
> > Clay Harryman

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ExecuteReader requires an open and available Connection. The connection's current state is Open, Executing. fniles Microsoft VB .NET 7 18th Apr 2007 02:51 AM
ExecuteScalar requires an open and available Connection. The connection's current state is Open, Executing. hasmukh4u@gmail.com Microsoft ADO .NET 0 2nd Feb 2007 02:30 PM
check database connection/open =?Utf-8?B?bWFydGluMQ==?= Microsoft VB .NET 14 21st Jul 2006 04:45 PM
How to check for an open network connection? =?Utf-8?B?dnJrMQ==?= Microsoft Excel Programming 0 20th Jun 2005 06:07 PM
How to check for an open Network connection in Excel VBA? =?Utf-8?B?dnJrMQ==?= Microsoft Excel Programming 0 18th Jun 2005 02:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:27 AM.