Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Posts
    29

    Unhappy Unanswered: Get URL text data in Access Code

    Ok so here is the problem. I am trying to access a text file stored on a server location across the intranet. What I need is a help with the code that will allow me to access the data. From there, I will have no problem making the tables and manipulating the data.

    I have been trying to get the xmlHTTP stuff to work and I keep retrieving the message from the URL that the "GET" operation is not valid.

    The code I am trying to use looks something like this currently:

    xmlText = "<website>CalData</website>"
    set xmlDom = CreateObject("Microsoft.xmlDOM")
    xmlDOM.loadXML xmlText

    set xmlHTTP = CreateObject("Microsoft.xmlHTTP")
    xmlHTTP.open "GET", "http://localhost/.....", False
    xmlHTTP.send (xmldom.xml)
    AVar = xmlHTTP.responseText

    msgbox AVar

    Any help would be greatly appreciated.

    Thanks

  2. #2
    Join Date
    Sep 2003
    Posts
    29

    Smile Re: Get URL text data in Access Code

    Hello again,

    Here is the solution I used to conduct this process. In short, I had to get the data and load it in to a table.

    Dim fs, ts, f
    Dim CalData As XMLHTTP

    Set CalData = CreateObject("Microsoft.xmlhttp")
    CalData.Open "GET", "http://localhost/fc/forwardCalController/exportFile?fn=WeeklyCalData", False, "UserID", "Password"
    CalData.send (Avar)

    Set fs = CreateObject("Scripting.filesystemobject")
    fs.CreateTextFile "c:\Temp\CalData.txt"
    Set f = fs.GetFile("C:\Temp\CalData.txt")
    Set ts = f.OpenAsTextStream(2, TristateUseDefault)
    ts.Write CalData.responseText
    ts.Close

    DoCmd.TransferText acImportDelim, "GetURLDataI", "tbl_CalData_Import", "C:\Temp\CalData.txt"


    This worked for my purposes

    Originally posted by abboabbo
    Ok so here is the problem. I am trying to access a text file stored on a server location across the intranet. What I need is a help with the code that will allow me to access the data. From there, I will have no problem making the tables and manipulating the data.

    I have been trying to get the xmlHTTP stuff to work and I keep retrieving the message from the URL that the "GET" operation is not valid.

    The code I am trying to use looks something like this currently:

    xmlText = "<website>CalData</website>"
    set xmlDom = CreateObject("Microsoft.xmlDOM")
    xmlDOM.loadXML xmlText

    set xmlHTTP = CreateObject("Microsoft.xmlHTTP")
    xmlHTTP.open "GET", "http://localhost/.....", False
    xmlHTTP.send (xmldom.xml)
    AVar = xmlHTTP.responseText

    msgbox AVar

    Any help would be greatly appreciated.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •