473,654 Members | 3,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB6: Load Website / Retrieve data

2 New Member
Hello Everybody,

I am sure somebody would be able to help me, I will be forever in your debt :)

Here is the scenario, I have a website and say for this sake it is a profile database basically.

Right, I want Visual Basic to load say, my profile on the website so I put

http://www.<url>.com/search_profile. php=John011

It retreives the data and puts it on the webpage. The information retreived will display something like (in plain format (no fancy graphics on the page just plain text))

Firstname: John
Location: Home :P

What I basically want to do is put the profile name in Visual Basic, it loads the page in the background and saves that data to a text file on my computer for the profile I have searched.

I want to be able to search for a profile I put in, and it appends a file with any other profile which I might put in.

Thank you for you wisdom ! :)
Jun 28 '07 #1
3 8203
danp129
323 Recognized Expert Contributor
What have you written so far?
Jun 28 '07 #2
John0111
2 New Member
Ok, at the moment what I really need is just to load the page in the background of VB and then store that web page to a text file with the results.
Jun 28 '07 #3
danp129
323 Recognized Expert Contributor
Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Private Sub Command1_Click()
  3.     Dim sHTML
  4.     sHTML = RequestText("http://news.google.com")
  5.  
  6.     WriteToFile "c:\test.html", sHTML
  7.  
  8.     Debug.Print sHTML
  9. End Sub
  10.  
  11. Private Function RequestText(sURL, Optional sMethod = "POST")
  12.     'You may have caching issues using GET
  13.     Dim XMLHTTP
  14.     Set XMLHTTP = CreateObject("microsoft.XMLHTTP")
  15.     sMethod = UCase(sMethod)
  16.     XMLHTTP.Open sMethod, sURL, False
  17.     XMLHTTP.send (Null) '"x=x"
  18.     RequestText = XMLHTTP.responseText
  19.     Set XMLHTTP = Nothing
  20. End Function
  21.  
  22. Private Sub WriteToFile(sPath, sText)
  23.     Dim frfile As Long
  24.  
  25.     'open the text file to be written to
  26.     frfile = FreeFile()
  27.     Open sPath For Output Access Write As #frfile
  28.  
  29.     Print #frfile, sText
  30.  
  31.     Close #frfile
  32. End Sub
  33.  
  34.  
I usually do something like this unless there's a script that has to be run in javascript that writes the data I need to get after the document loads, in which case I use IE or a web browser control and read the innerhtml.
Jun 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
3936
by: Claudia Fong | last post by:
Hi, I have a form where I need to display the data of a department that stores in a access db. When I first load the form it will call a function name loaddata which will get the first record from the db and then display for the user: oleDbConnection1.Open();
1
3245
by: funcSter | last post by:
I want to retrieve data from an Excel file like how I would with a database. I understand that I would have to use OLE DB. Somehow I think I cannot get the connection string right, as the bit of code fails at "objConn.Open()" with the error: System.Data.OleDb.OleDbException: Could not find installable ISAM. Can somebody please help me out? I'm still a learning programmer, so if someone can point out my mistakes, it'll be great! Thanks! ...
5
2428
by: ggk517 | last post by:
We are trying to develop an Engineering application using PHP, Javascript with Informix as the back-end. Is it possible to retrieve data using Javascript but by accessing the Database. Say somebody enters part_no, than using Javascript is it possible to connect to the part master and retrieve the division and desc information? I am not allowed to use the PHP because this will require the user to insert the part number on the first...
8
7195
by: Yoshitha | last post by:
Hi I want to Extracet(retrieve) data from some of websites and the retrieved data has to be saved in excel or.csv files. I need to develop this in ASP.net(using C#.net Vs 2003). Can any one tell me the idea of how to get data from websites?
1
3015
by: deepaks85 | last post by:
Dear Sir, Is there any way to Get / Retrieve data from any website? I want the contents from a website into my website so that the contents can automatically update if the contents get changed in original website. How can I do that? Please help me out.
1
3026
by: hims | last post by:
hi i want to retrieve data from access through vb6.0 program but its not working. either sort out my error or help me with correct coding. thanks in advance !!!!!!! mail me at himanshu_s27@rediffmail.com my coding: Private Sub Command5_Click() Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset
14
4193
by: rinu mariam johnson | last post by:
I want to retrieve data from a website based on a file number.But i have to do this programmatically using vb.net and finally have to store the results in a csv file. In my web application,i will give the file number in a textbox(through GUI) and the site address(through vb.net code) and when i click the search button,the csv output should be obtained. I am fed up with this problem for the last 2 weeks..can anybody pls help me in this...
12
77985
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please give me some idea where I am going wrong ?? I just want to retrieve data from my emp_mstr table and display it using my JSP file... The table emp_mstr is as follows :- CREATE TABLE EMP_MSTR( EMP_NO VARCHAR(10) PRIMARY KEY, PASSWORD...
0
1359
by: lenniekuah | last post by:
Hullo Good Guys, I need your help. Please help me. I am very surprise of this error message: Index was out of range. Must be non-negative and less thatnt he size of the collection. Parameter name :Index I am using C#NET2008 and try to retrieve data from the Clicked Row and it’s not working to my surprised. It has not happened before. This particular problems is because the SQL String retrieve 13 data columns from SQL SERVER Table to fill...
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8815
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.