Network/webpage programming
i need some explanation regarding the concept of connecting between a local app to online web server information..For example, visior submit some comments over the web and i need to write a small app which can retrieve the information and store them in local database , and can later be retrieved n display in the app for reference.
Another question would be is asp considered as the web server for storing information that user submit over the web..where would the information user submitted be stored?
Re: Network/webpage programming
I don't use ASP myself, I use PHP. Both of them are server-side scripting languages that run on the web server.
Usually this means:
HTML form (that user submits) -> Server-side code (PHP/ASP) which writes to database -> MySQL or other database to store data
That's how most sites work. PHP/ASP, whatever you're using, stores the entered information in a database.
To get that information back to your own computer, your program needs to communicate with the database on the web server. There are a lot of ways to do it. A direct connection from your computer to the online database is hard, since most servers don't allow access directly to the database since it is insecure.
Instead, you usually need some sort of middle-man to pass data back and forth between your program and the database on the server. Again, this can be done using a server-side scripting language like ASP or PHP.
An example would be a PHP file on the site that gets information from the database and displays it on the webpage, ex:
http://www.mysite.com/database_dump.php
database_dump.php could read from the database on that server and print the results as HTML. All your program would need to do is navigate to that URL, retrieve the HTML source, and parse/process it and store it to a local database.
What language are you writing your program in?
Re: Network/webpage programming
thanks for your explanation, it helps me in understanding it...my program would have to be in visual basic, i was thinking to use vb6 for the program..
So in terms of processing the HTML source, the program has to do lots of filtering in order to get the correct information needed?
If i choose to use mysql to store the data online, i wonder how to have the online mysql database established..normally when i use it locally, there's a query browser to explore through the database but when its online, i cant imagine hows it is like.
By the way, IIS has to be installed on my pc as well? or every webpage running the page should have IIS installed. because i'm still in the process of finding out what actually IIS does.
Re: Network/webpage programming
You'll need to write and test your pages locally, so for that you'd need IIS to run your ASP pages. To connect to your SQL Server database, you'd need to use ADODB (if using ASP) or ADO.NET (if using ASP.NET). The connection is established by using your connection string and the data providers.
If you go 'online' (meaning you get a web host) then you'll need to upload your files there and run your scripts against your MySql database and change your connection string so that the files can see the relevant database.
Re: Network/webpage programming
You have a number of ways to skin this cat.
If you were using ASP and a Windows host, one of the more obvious ways would be to have a special web query done by your VB6 program to return the results as a persisted ADO Recordset in either XML or ADTG format.
You could also return the data back to the VB6 program in CSV format.
You could also return the data in an ad hoc XML format (not the ADO Recordset format).
And finally you might return the data as HTML, perhaps as a page with an embedded <table>.
The nice thing is that back in the world of VB6 you can handle all of these using ADO. You can also process ad hoc XML using the MSXML DOM if you chose to.