Want to Automatically Connect to Internet through Proxy

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
Who is Participating?
Richie_SimonettiConnect With a Mentor IT OperationsCommented:
Take a look at this thread:
The last post from asker could do the trick.
Richie_SimonettiIT OperationsCommented:
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.
waleed_makaremAuthor Commented:
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

waleed_makaremAuthor Commented:
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
Richie_SimonettiIT OperationsCommented:
I mean, if by default, you internet config uses proxy, there is no problem at all.
Maybe i misunderstood something.
waleed_makaremAuthor Commented:
hi Experts,

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

Richie_SimonettiIT OperationsCommented:
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.
waleed_makaremAuthor Commented:
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
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
Finalized by Moondancer - EE Moderator
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.