Definition answer

Hi everyone,

Can anyone explain these two items and what they do in easy to understand grammar?

Private Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long

Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


InternetOpen:  Opens an internet session
InternetConnect: Opens an File Transfer Protocol (FTP), Gopher, or HTTP session for a given site.  

You would use both of these functions to interact with an FTP site. A task common to almost every job is uploading a file to an FTP server for some person to download.


Open internet connection:
lngInet = InternetOpen ("AutoFTP", 1, vbNullString, vbNullString, 0)
'AutoFTP' is the argument we use to refer to the connection. '1' means we are creating an FTP connection

'Connect to FTP site
lngINetConn = InternetConnect (lngInet, "", 0, "username", "password", 1, 0, 0)

For more details regarding wininet.dll (Windows Internet API) go here:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
KudzullcAuthor Commented:

Thanks for the help?!  I am maybe looking at the wrong thing.  If you cant answer me this I will still give you points.  I am looking at some VB6 code and trying to find where they called access to a coldfusion site behind a login.  Meaning this app is allowed past the permissions to access the database.  Do you know if it is the wininet.dll that allows this.
 Similar to this call
lngINetConn = InternetConnect (lngInet, "", 0, "username", "password", 1, 0, 0)
I cant find anything similar, am I looking in the wrong place?


Is xmlhttp allowed access to the site without permission?!  (ie App calls to access information)

Thanks again!

According to MSDN:

<<< The Windows Internet (wininet.dll) application programming interface (API) enables applications to interact with Gopher, FTP, and HTTP protocols to access Internet resources. >>>

Therefore, it seems this API doesn't have the capability to provide access to a database, only internet resources.

Also,  is used to access both binary and simple HTML data from any web site. Again, doesn't allow access to a database.  
KudzullcAuthor Commented:
Was just reading that.  Thanks for your help.  When xmlhttp hits the http site, it requests and sometimes puts information into a coldfusion page.  But when I try and access that url & filename i get access denied.  somewhere in this code, it is passing these permission before xmlhttp request these pages OR is xmlhttp exempt these type of permissions?

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

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.