CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: VB script

  1. #1
    Join Date
    Apr 2001
    Posts
    8

    VB script

    On a asp page trying to create an rtf file from a database using VBscript. I would like to create the file only upon a button click.
    Set fso = CreateObject("Scripting.FileSystemObject")
    gives this error
    Active X component can't create object.
    This only occurs if it is inside <script></script> tags. It works if the file is created on page load and code is in <% %>.
    Is there a way around this?
    Any suggestions will be greatly appreciated, and I am reletively new to VB programming.
    TIA

    DJS


  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: VB script

    The reason you get the error is because the browser the script runs in, won't allow any scripts to access the disk (except for cookies).
    When the code is between <% %>, it's asp, and asp is ran at the server (wich in most cases does allow file management).

    Tom Cannaerts
    [email protected]

    The best way to escape a problem, is to solve it.
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

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