473,320 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem in getting response from remote server

I am having problem in getting response from remote server for that I have written following script response got correctly but the data on the page is not displayed it gives “–“ in place of grid data. It’s because when actual page load in web browser it shows “-“ until loading is not completed after that it gives actual value after successful completion of loading of the page.

Script I have written is as follows :
Expand|Select|Wrap|Line Numbers
  1. <%
  2. Response.Write("<SPAN class='tt'>Corn Futures (CZ)</SPAN>")
  3. Const REMOTE_FILE_URL="http://www.cmegroup.com/trading/commodities/grain-and-oilseed/corn_quotes_globex.html"
  4.  
  5. Call ShowRemoteFile
  6.  
  7. Sub ShowRemoteFile
  8.     Dim objXML, strContents, arrLines
  9.     Dim x
  10.     Set objXML=Server.CreateObject("Microsoft.XMLHTTP")
  11.  
  12.     'read text file...
  13.     objXML.Open "GET", REMOTE_FILE_URL, False
  14.  
  15.     objXML.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
  16.  
  17.     objXML.Send
  18.     strContents=objXML.ResponseText
  19.  
  20.     Set objXML=Nothing
  21.  
  22.     'split into lines and read line by line...
  23.     arrLines=Split(strContents, VBCrLf)
  24.     For x=0 To UBound(arrLines)
  25.         If InStr(arrLines(x), "<Table>") or InStr(arrLines(x), "<th") or InStr(arrLines(x), "<tr") Then
  26.             If not InStr(arrLines(x),"<i>") Then
  27.             'If InStr(arrLines(x), "<Table>") or InStr(arrLines(x), "<tr>") or InStr(arrLines(x), "<td>") or InStr(arrLines(x), "xmlns:xs") Then
  28.                 Response.Write(arrLines(x)&"<br />")
  29.             'End If
  30.             End If
  31.         End If
  32.     Next
  33. End Sub
  34. %>
Jan 8 '10 #1
3 1923
jhardman
3,406 Expert 2GB
It looks to me like you need to find a better data source. The website you are pulling from is designed for human browsers, you need to find a webservice or some such. I think after you find a better source there will be no problem.
Jared
Jan 8 '10 #2
vtp82
6
First of all Thanks for your reply.
And is there any datasource which pools data from anther server rather then getting response and store into the string ? exactly what i want is the HTML Table object like DomElement from that page and display it on to my page.
Jan 9 '10 #3
vtp82
6
First of all Thanks for your reply.
And is there any datasource which pools data from anther server rather then getting response and store into the string ? exactly what i want is the HTML Table object like DomElement from that page and display it on to my page.
Jan 9 '10 #4

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

Similar topics

4
by: Jaydeep | last post by:
Hello, I am facing a strange problem. Problem accessing remote database from ASP using COM+ server application having VB components (ActiveX DLL) installed. Tier 1 : ASP front End (IIS 5.0) Tire...
1
by: Bruce Wiebe | last post by:
hi all Im having a big problem connecting to a SSL site (HSBC Bank) using httpWebRequest. what i need to do is connet to the site and pass over an xml string and read the response. Im pretty...
22
by: Kristof Thys | last post by:
Hello, I'm developing a C# - windows forms application. To get some information for my application, I'm connecting to an URL, wich gives me XML generated using php. With 90% of the users, this...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
11
by: myhyli | last post by:
I want to get some files from another remote server,so: 1.at first, I use xmlhttp(activeXObject),but I found it will not work with some url like: http://rss.xinhuanet.com/rss/it.xml , and some...
1
by: Nathan Sokalski | last post by:
I have retrieved data from a database using a SELECT statement that includes an INNER JOIN. The data seems to be retrieved to the DataSet OK, but I am having trouble getting the data from the...
3
by: Ron L | last post by:
I have an application that I am working on with 2 other developers. The applciation uses Remoting for our calls to SQL Server. We have been developing and testing against our development machines...
0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
4
by: CindyH | last post by:
Hi: I have the following code: Dim url As String = "http://xx01xx01:800/some.ashx" Dim myrequest As System.Net.WebRequest = Nothing Dim myresponse As System.Net.WebResponse = Nothing...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.