Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17



Posted on 1999-07-06
Medium Priority
Last Modified: 2012-05-04
My previous message question was lost. I want to know how to disconnect the isp from dial up networking and then reconnect it at any time. Can this be done easily?
Question by:GoofyJoe99
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1522212
I'd bet the Crescent internet toolpack would have a solution for your needs.  They had everything including a RAS dialup control.  Search Yahoo or somebody for "Progress Crescent Internet Toolkit" and check out their stuff.  They do have some pretty cool stuff.  Less cool now that Microsoft include HTTP and some basics but still very new good ocx controls.

Accepted Solution

Torus earned 200 total points
ID: 1522213
Public Const RAS_MAXENTRYNAME = 256
Public Const RAS_MAXDEVICENAME = 128
Public Const SUCCESS = 0

Public Type RASCONN
    dwSize As Long
    hRasConn As Long
    szEntryName(RAS_MAXENTRYNAME) As Byte
    szDeviceType(RAS_MAXDEVICETYPE) As Byte
    szDeviceName(RAS_MAXDEVICENAME) As Byte
End Type

Public Declare Function RasEnumConnections Lib "rasapi32.dll" Alias "RasEnumConnectionsA" (lpRasConn As Any, lpcb As Long, lpcConnections As Long) As Long

Public Declare Function RasHangUp Lib "rasapi32.dll" Alias "RasHangUpA" _
            (ByVal hRasConn As Long) As Long

Public Function hangUp() As Boolean

Dim lpRasConn(255) As RASCONN
Dim lpcb As Long
Dim lpcConnections As Long
Dim lReturnCode As Long
Dim I as integer

lpRasConn(0).dwSize = LenB(lpRasConn(0))
lpcb = RAS_MAXENTRYNAME * lpRasConn(0).dwSize
lpcConnections = 0
lReturnCode = RasEnumConnections(lpRasConn(0), lpcb, lpcConnections)
If lReturnCode = SUCESS then
    For I = 0 to lpcConnections - 1
           call RasHangUp(lpRasConn(0).hRasConn)
    next I
end if

end sub

Public Sub AutoDial()

     'If you are using win95/98, use the following code
     Call  Shell("rundll32.exe rnaui.dll,RnaDial " & "YourPhonebookEntryName", vbNormalFocus)
     SendKeys "{enter}", True
     'If you are using NT, use the following code instead
     Call  Shell("Rasphone -d " & "YourPhonebookEntryName", vbNormalFocus)
End Function


Author Comment

ID: 1522214
Hey thanks torus!! And Informative too, thanks!!!

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question