[AccessD] detect network

jeffrey.demulling at usbank.com jeffrey.demulling at usbank.com
Fri Jun 20 09:47:45 CDT 2003


Jim,

Since you are "dumping" the data to a central SQL database why not check 
to see if you can connect to the SQL database.  The code you could use is 
as follows:



Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
With cnn
 .Provider = "SQLOLEDB"
 .CursorLocation = adUseClient
 .ConnectionString = "Data Source=VENUS;" & "User ID=sa;" _
     & "Initial Catalog=MyDatabase;"
 .Open
End With
'Make sure the connection opened:
If Not CBool(cnn.State AND adStateOpen) Then
 'Could not open the connection:
 MsgBox "Could not open connection..."
Else
 'Process data as usual here...
End If

I found this code at the following site:

http://doc.advisor.com/Articles.nsf/nl/12481








-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Jim DeMarco
Sent: Thursday, June 19, 2003 8:33 AM
To: AccessD (E-mail)
Subject: [AccessD] detect network


We've got a data collection application that will be run on disconnected
laptops.  At least once a week the laptop users will come in to the home
office to dump the data they've collected into our central SQL database.
Does anyone have any code that will detect that the laptop is connected to
our network so we can point their connection to the central DB (as opposed
to their local DB)?  Or should we just try to hit the central DB at app
start and trap the error?  I don't want to generate an error if I don't 
have
to.

Thanks,

Jim DeMarco
Director of Product Development
HealthSource/Hudson Health Plan


****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from Hudson Health Plan (HHP) that 
is
confidential or privileged.  If you are not the intended recipient, you 
are
hereby notified that any disclosure, copying, distribution or use of the
contents of this message is strictly prohibited.  If you have received 
this
message in error or are not the named recipient, please notify us
immediately, either by contacting the sender at the electronic mail 
address
noted above or calling HHP at (914) 631-1611. If you are not the intended
recipient, please do not forward this email to anyone, and delete and
destroy all copies of this message.  Thank You".
****************************************************************************
*******

_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030620/6b55e4c9/attachment-0001.html>


More information about the AccessD mailing list