Now, we can get started on the VB portion of this tutorial. Create a new ActiveX
DLL project in VB, and set the Project's name to 'ASPUploadComponent'. Next,
create two Classes to the project, and call them cUpload and cFormItem respectively.
cUpload's Instancing property should be set to 5 - MultiUse
, and
cFormItem's should be set to 2 - PublicNotCreatable
.
Finally, you need to add a reference to the ASP Type Library. To do this, go
to Project|References, and check the box next to Microsoft Active Server Pages
Object Library, and the Microsoft Scripting Runtime (so we can use the FileSystemObject
).
Now we can get coding...!
Debugging an ASP Component Therefore, your only option is to compile your component each time you make a change. However, it gets worse... When your script accesses the component for the first time, it locks the file. Your OCX file is not unlocked again until the IIS service stops, meaning that each time you want VB to re-compile the component you have to restart IIS (and not just the web you are using either... all of IIS!). To restart IIS, go to Services, select World Wide Publishing Service, and click Restart. |
One last thing... if you would prefer to skip the VB coding section, you can download the source code and binaries here. Then, you can skip to this step.
Comments