CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2002
    Location
    Calgary, AB. Canada
    Posts
    5

    VBScript <A href=file output error

    Hi,

    Here's what I'm trying to do.

    wohno is a variable assigned for a work order number.

    strSQL= strSQL & " '<A href=file:' + 'P:\' + wohno + '.pdf' + '>' + wohno + '</A>' "

    When i go to click on this it doesn't take the whole file path and I'm pretty sure it's because the file and path aren't in double quotes. I just can't figure out how to put them in so that it works.

    any help would be much appreciated
    Dione

  2. #2
    Join Date
    Jun 1999
    Location
    England
    Posts
    86
    strSQL ='<A href=file:' + 'P:/' + wohno + '.pdf' + '>' + wohno + '</A>'

    try turning backslashes into forward slashes and see if that works.

  3. #3
    Join Date
    Aug 2002
    Location
    Calgary, AB. Canada
    Posts
    5
    So apparently I'm having a moment. It does display the workorder number, what it doesn't display is the .pdf at the end. Am I doing it correctly. I want this to create a pdf file that I can open later.

    I'm not sure if it's the correct way to do it.

    Dione

  4. #4
    Join Date
    Aug 2002
    Location
    Reykjavik, Iceland
    Posts
    201
    To play it safe you should change it to this:

    strSQL = strSQL & " '<a href=\"file:///P:/' + wohno + '.pdf\">' + wohno + '</a>' "

    Note that the href is surrounded in quotes to be XHTML compliant and to be safe in case a file name or directory contains spaces. Also the file protocol specifier should be followed by 3 forward slashes.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured