Go Premium for a chance to win a PS4. Enter to Win


Want to Automatically Connect to Internet through Proxy

Posted on 2002-03-07
Medium Priority
Last Modified: 2010-05-02
Hi Experts,

i had a problem before , i asked this problem to experts under "Want to automatically download a file from the net" at a specitic site "not direct site" and Ark answered this question by a "MAGIC" Code, the problem now is that i tesed this sotware in my home "using normal internet connection "through Dial up networking and TCP/IP " i made code to connect and test connection and download file based on this internet acces protocol. but the problem now is that this software will work on a Proxy server "leezed line", so does my code work or not, and if not , how to write code to perform the following on proxy server,
1- How to Test connection to the net
2- How to automatically connect to the net through proxy
NB. in this proxy, it is on Windows NT, to enter the net, i click the inernet explorer, a message box require authentication ID (username and password). so what is the code to automatically connect to the net through a proxy server and go to a specific site eg www.yahoo.com

the code that Ark made for me to automatically connect to the net  and download this data files is this :--


From: Ark  Points: 70  
I thought that my previous code works for you :(
As I mentioned earlier, progreess bar almost impossible (BTW, why do you need progress bar if you want
to start it from sheduler?) - this process doesn't control by application. First page send request to
server's executable and the server process this request, so we donno progress (and it's about 90% of

PS. For other Experts - here is my previous code:
(DAOXXX and Microsoft Internet Controls referenses required)

Dim sCaption As String

Public Function SaveRSCatalog(ByVal sFileName As String, Optional sFieldSeparator As String = ",") As
'  On Error Resume Next
 Set ie = New InternetExplorer
'  Dim wnd As New SHDocVw.ShellWindows
'  Set ie = wnd(2): GoTo cont
 ie.Navigate "http://www.usp.org/cgi-bin/refstd/SoftCart.exe/refstd/frameset.htm?E+refstd"
'===Remove following string to make process invisible===
 ie.Visible = True
'=====Just for viewing progress======
 sCaption = "Connecting to main page...."
 Caption = sCaption
 While ie.ReadyState < 4
 sCaption = "Downloading catalog......"
 Caption = sCaption
 Me.Print "Be patient, downloading of 70K can take few minutes"
 While ie.Busy
 While ie.ReadyState < 4
 sCaption = "Saving to " & sFileName & "..."
 Caption = sCaption
 Dim i As Integer, nCells As Long
 Dim nRow As Integer, nCol As Integer
'===Create New *mdb file=======
 If Dir(sFileName) <> "" Then Kill sFileName
 Dim dbsNew As Database
 Dim tbDef As TableDef
 Dim rs As Recordset
 Set dbsNew = DBEngine.Workspaces(0).CreateDatabase(sFileName, dbLangGeneral)
 Set tbDef = dbsNew.CreateTableDef("Catalog")
 With tbDef
     .Fields.Append .CreateField("Cat_No", dbText)
     .Fields.Append .CreateField("Cost", dbText)
     .Fields.Append .CreateField("Prev_Lot", dbText)
     .Fields.Append .CreateField("Current_Lot", dbText)
     .Fields.Append .CreateField("Description", dbMemo)
 End With
 For Each fld In tbDef.Fields
     fld.AllowZeroLength = True
 dbsNew.TableDefs.Append tbDef
 Set rs = tbDef.OpenRecordset
'======Saving data===============
 For Each d In ie.Document.frames("USPbody").Document.All
     If TypeName(d) = "HTMLTable" Then
        If i = 1 Then
            nCells = d.cells.length
            For nRow = 2 To nCells / 5
                cellnum = (nRow - 1) * 5
                rs!Cat_No = Left(d.cells(cellnum + 1).innerText, 6)
                rs!Cost = Mid(d.cells(cellnum + 1).innerText, 9)
                rs!Prev_Lot = d.cells(cellnum + 2).innerText
                rs!Current_Lot = d.cells(cellnum + 3).innerText
                rs!Description = d.cells(cellnum + 4).innerText
                rs.Bookmark = rs.LastModified
                Caption = sCaption & CInt(cellnum * 100 / nCells) & "% done"
            Next nRow
            Exit For
        End If
        i = i + 1
     End If
 Caption = "Done!"
 Set ie = Nothing
 SaveRSCatalog = (FileLen(sFileName) > 0)
 rs.Close: Set rs = Nothing
 Set tbDef = Nothing
 dbsNew.Close: Set dbsNew = Nothing
End Function

Private Sub Command1_Click()
 SaveRSCatalog "test.mdb"
End Sub

Private Sub ie_ProgressChange(ByVal Progress As Long, ByVal ProgressMax As Long)
 If ProgressMax > 0 Then Caption = sCaption & CInt(Progress * 100 / ProgressMax) & "% done"
End Sub



thank u so much for ur interest,
Best Regards,
Dr.Waleed Said Abul Makarem
Question by:waleed_makarem
  • 4
  • 4
  • 2
LVL 16

Expert Comment

ID: 6852258
If your configuration is setted with proxy, everything should works fine.If not you could use some api stuff to get connected and after that launch previous code from Ark.

Author Comment

ID: 6852956
i think that this may be ok but which api code i use??

also , if u read Ark's code, u will find that he uses INVISIBLE Internet explorer . but when i open new internet explorer window in windows NT, a messagebox requires the user id and password "Authentication" . that is mean that when the software simulate this process , ie , the software must pass the user id and password in order to avoid error message,
Do u get me ?
so what is the code that i can use to pass the user id and password programatically so that the proxy will not require authenticatin ID

thanks for ur interest,
Best Regards,
Dr.Saleed Said abul makarem

Author Comment

ID: 6852970
hi Richie,
what did u mean by ur proxy configurations are setted ?
i really do not know ANYtHING in proxy and networks ut what i know about this proxy is :--

1- when i open a new inernet explorer window, a message box require the id and password

2- it is better NOT to make any proxy setting changes that will affects its security,as the comp. i work in is multinational and i want the software not to conflict or cause any problems with the proxy,

3- any inforamtion u want on this proxy, i can ask the IT engineers in the comp.

thak u again for u help,
Dr.waleed said abul makarem
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 16

Expert Comment

ID: 6854144
I mean, if by default, you internet config uses proxy, there is no problem at all.
Maybe i misunderstood something.

Author Comment

ID: 6854293
hi Experts,

so , how can i programatically pass the user id and password to the proxy to get authentication to enter the the internet

LVL 16

Expert Comment

ID: 6855083
I thinks it depends upon how proxy security is implemented.
You could try with InternetConnect API but i guess that username and passw parameter are for server at the end of the line not the proxy.

Author Comment

ID: 6855167
hi richie,

i really do not understand,
can i use this software at proxy without passing the user id and passowrd "i doubt"
and if not , which code to use to pass this user id and password ? by api ,. how ?

Dr. waleed said abul makarem
LVL 16

Accepted Solution

Richie_Simonetti earned 240 total points
ID: 7008527
Take a look at this thread:
The last post from asker could do the trick.

Expert Comment

ID: 7017660
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
POINTS FOR EXPERTS awaiting comments are listed in the link below
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
Thanks everyone.
Moderator @ Experts Exchange

Expert Comment

ID: 7077080
Finalized by Moondancer - EE Moderator

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

783 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