Click to See Complete Forum and Search --> : VB script


DJS
April 13th, 2001, 07:34 AM
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

Cakkie
April 13th, 2001, 09:45 AM
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
slisse@planetinternet.be

The best way to escape a problem, is to solve it.