Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default How to check for an open network connection?

I need to connect to an Access db on a Network File Server from my Excel VBA.
Please see my code below. Is there a better method instead of using a Shell
statement here? Someone told me Shell() statements are a lot of performance
overhead.

My question is:
1. Is there an alternate method to open a network connection instead of
using Shell statement.
2. Before opening a Network connection, I would like to check if this
network connection is open already. If it is, I dont want to do anything.
Otherwise, I would like to initiate a new connection.

If someone can throw some light here, I would really appreciate it.

Thanks.

___________________________
Sub test()

Shell ("net use \\fileserver\ipc$ /user:domain\uid pwd")

Set db = OpenDatabase("\\fileserver\share\folder\test.mdb", False, True, "MS
Access;PWD=12345")

other statements follow here.....

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Network connection for query ken Excel Discussion (Misc queries) 0 February 12th 10 07:43 AM
missing network connection dsdproduction Excel Discussion (Misc queries) 0 July 5th 07 02:36 PM
Checking if you have a network connection clayton Excel Discussion (Misc queries) 0 May 31st 06 04:31 PM
How to check for an open Network connection in Excel VBA? vrk1 Excel Programming 0 June 18th 05 02:58 AM
Detecting a network connection Eric Excel Programming 1 February 5th 04 04:30 PM


All times are GMT +1. The time now is 10:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"