Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Posts
    3

    Unanswered: Can I call an ASP script from Access to upload files?

    Does anyone know if it is possible to call an ASP page on a remote web server and pass it parameters?

    I have an Access 2002 database that I want to use off-line to gather data and images and then upload the lot to a web application running SQL Server. Getting the data into SQL isnt a problem but I need to be able to run a script that will upload the images to a folder on the web server.

    Im running out of hair to pull out on this one, so any help you can give would be greatly appreciated.

    David

  2. #2
    Join Date
    Jan 2007
    Location
    California, USA
    Posts
    520
    You can use the Application.FollowHyperlink method to open a web page. If the web page itself is the .asp code that you want to run, then this will do it for you.

    Example:
    Application.FollowHyperlink "http://www.vicrauch.com/AccessTips.htm", , True, True

    Hope this helps,

  3. #3
    Join Date
    May 2007
    Posts
    3
    Hey Vic,

    Thank you for taking the time to reply. That looks like the solution I need, I hadn't realised you can call a hyperlink from code, but based on your post, I'm planning to use a function something like this:


    Public Function UploadIt(FileName As String)
    Dim strAddress As String

    On Error GoTo Error_UploadIT

    ' Create the hyperlink address.
    strAddress = "http://www.myserver.com/myscript.asp?filename=" & FileName


    ' Follow hyperlink address.
    Application.FollowHyperlink strAddress, , True, True


    Exit_UploadIT:
    Exit Function

    Error_UploadIT:
    MsgBox Err & ": " & Err.Description
    Resume Exit_UploadIT
    End Function



    Haven't tested it yet because I now need to modify the asp page to work with querystrings rather than form elements, but I will let you know if it works OK.

    Many Thanks

    David

Posting Permissions

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