Wrox Programmer Forums
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 25th, 2009, 01:24 PM
Registered User
 
Join Date: May 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get data off a web grid

Hi. I am an excellent VB programmer but a poor web programmer. I am trying to get some data off a grid on a web page into a vb app and I am having a terrible time doing it. The site also requires an id and password. The site is http://ctmls.mlxchange.com/ and I'm using VB 6 on Vista.
I don't care what form I get the data in but its not in the source when I view it or save the page. It looks like it is coming from javascript. Can I find out what script is getting the data and run it?
I think it changes pages in frames because the address never changes, but the display does. That's why I don't think I can use winsock. Inet doesn't work.

Here's how I get the data on the screen:
  1. Type in URL; go to site
  2. Login to site, frame changes
  3. Click "Search" from menu, frame changes
  4. Type in some criteria, click results
  5. Frame loads with a grid with data on I need to get into VB
The Userid is not mine, I am using it to write this program for the owner.

I found this code on another forum:
Private Function PrintDomBegin(hDoc As MSHTMLCtl.HTMLDocument) As Long

Dim str As String
Dim str2 As String
Dim ElemColl As Object 'MSHTMLCtl.HTMLElementCollection

If Not hDoc Is Nothing Then
frmDetail.List1.Clear
Set ElemColl = hDoc.getElementsByTagName("HTML")
str = PrintDom(ElemColl, str2, 0, 0)
frmDetail.Text1 = str
End If

'PrintDomBegin = ElemColl.Count

End Function

Private Function PrintDom(ByVal ElemColl As Object, ByRef ReturnStr As String, ByVal lngDepth As Long, lngIndex As Long) As String

Dim str As String
Dim strKey As String
Dim strElemName As String
Dim Elem As MSHTMLCtl.HTMLDTElement

For Each Elem In ElemColl

lngIndex = lngIndex + 1
strKey = "Frame: " & Trim(CStr(mlngFrameIndex)) & " - Depth: " & Trim(CStr(lngDepth)) & " #" & Trim(CStr(lngIndex))
mcol.Add Elem, strKey
frmDetail.List1.AddItem strKey

strElemName = Elem.getAttribute("ID")
If strElemName = "" Then
strElemName = "" & Elem.getAttribute("name")
If strElemName = "" Then
strElemName = "<no name>"
End If
End If

'If strElemName = "txtLogin" Then Debug.Print Elem.outerHTML

str = Space(lngDepth * 4)
str = str & (strElemName & ": " & Elem.tagName & "(Level " & lngDepth & ")")
ReturnStr = ReturnStr & str & vbCrLf

If (Elem.canHaveChildren) Then
PrintDom Elem.children, ReturnStr, lngDepth + 1, lngIndex
End If

str = ""
Next

PrintDom = ReturnStr
End Function
I found "txtLogon" with it, which I couldn't find anywhere else. But after I logon and try to look at other objects' outerHTML I get a "Permission Denied" error. I don't even know if anything useful is in there.

Any sugestions are appreciated.
[IMG]file:///C:/Users/Mar/AppData/Local/Temp/moz-screenshot-2.jpg[/IMG]





Similar Threads
Thread Thread Starter Forum Replies Last Post
Export data from data grid to excel pomoc VB.NET 2002/2003 Basics 0 December 16th, 2005 03:11 PM
Export data from data grid to Excel pomoc Visual Basic 2005 Basics 0 December 16th, 2005 02:56 PM
Infragistics web grid problem sandeep ADO.NET 1 June 27th, 2005 02:26 PM
trying to load db data into data grid itsajourney Beginning VB 6 2 June 7th, 2005 12:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.