Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Fetch multiple records

  Asked By: Hondo    Date: Nov 21    Category: MS Office    Views: 736
  

The Program works fine and fetch one record at a time and display in the
browser. Is it possible that i pass a list of socials into it and then i get
data in a textfile with three information Name, Birth and Death thru VBA code?

Private Sub Form_Load()
Dim social As String, WShell As Object, vPath As String
social = "260-54-6689"
Set WShell = CreateObject("wscript.shell")
vPath = WShell.SpecialFolders("MyDocuments") & "\"
vFile = vPath & "Deceased-Information-" & Format$(Now, "yyyymmdd-hhmmss") &
".html"
Debug.Print vFile
Open vFile For Output As #1
Print #1, PostURL("http://ssdi.rootsweb.com/cgi-bin/ssdi.cgi", "ssn=" & social)
Close #1
Set WShell = Nothing
ShellExecute 0, vbNullString, Chr(34) & vFile & Chr(34), vbNullString,
vbNullString, vbMaximizedFocus
Unload Me
End Sub
MODULE
Function PostURL(sURL, aPostData)
sURL = CStr(sURL)
Dim oXml
Set oXml = CreateObject("Microsoft.XMLHTTP")
oXml.Open "POST", sURL, False
oXml.setRequestHeader "Content-Type", "application/ x-www-form- urlencoded"
oXml.Send aPostData
PostURL = oXml.responseText
Set oXml = Nothing
End Function
Option Explicit
Public Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Lon

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Devrim Yilmaz     Answered On: Nov 21

It all depends on how the web site is designed. I don’t see a way to do this
with this web site, even using its Advanced Search features.

 
Answer #2    Answered By: Ella Brown     Answered On: Nov 21

I made an Excel file that does that...all you have to do is type
your list  of ssn's in column A then just select one or all and right-
click to bring up the short-cut menu where you could select the
command to start downloading. It will populate any infor mation
found.

One problem though. It appears that my account doesn't allow me to
upload files, so I may have to email it to you privately.

 
Answer #3    Answered By: Liam Bouchard     Answered On: Nov 21

Glad you got it working. No need to send  me anything  I can picture how it
would work. Must look great when it does it.

 
Didn't find what you were looking for? Find more on Fetch multiple records Or get search suggestion and latest updates.




Tagged: