Option Compare Database
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Function callvpn()
Dim cnn As Object
Set cnn = CreateObject("ADODB.Connection")
cnn.Open "DSN=p;UID=sa;PWD=000000;"
If cnn.State = adStateOpen Then
cnn.Close
Exit Function
Else
Call ShellExecute(0, vbNullString, "d:\post\temp\vpn\d.lnk", vbNullString, vbNullString, vbNormalFocus)
End If
End Function
|