943,557 Members | Top Members by Rank

Ad:
Dec 11th, 2007
0

Adding Micorsoft Scripting Runtime dll

Expand Post »
Post Thread: Searching Database file if existing or not.

How to Add the Microsoft scripting runtime dll in my Project reference menu. I saw Microsoft Script in the components. Is this the file?

Anybody can help me or give me step by step procedure to add this Microsoft Scripting runtime dll in my project.

Thanks
Reputation Points: 10
Solved Threads: 0
Light Poster
locsin is offline Offline
47 posts
since Aug 2007
Dec 11th, 2007
0

Re: Adding Micorsoft Scripting Runtime dll

scrrun.dll

That's the exact name of the dynamic link library (dll).

In that library of functions, the file system object can be referenced and used.

To add a reference to your project, simply click on the the Projects menu, click on the References Menu, and a form should show up listing the different libraries that are registered to be used with Visual Basic.

They are in alphabetical order. Look for Microsoft Scripting Runtime and check it's box, if it's not checked already. The Microsoft Script Control is a component used for writing scripts. It does not include the File System Object.

In the declarations section of your form you should declare your own File System Object. Declare an object variable
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Option Explicit
  2. dim MyFS0 as FileSystemObject
  3. Dim strFileName as String
And then you should instantiate the object or make an instance of the object using the Set statement
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Form_Load()
  2. Set MyFSO = New FileSystemObject
  3. ' You can now use it.
  4. if MyFSO.FileExists(strFileName) then
  5. ' Code if it exists
  6. else
  7. ' Code if it doesn't exist
  8. endif
  9.  
  10.  
  11. ' Be careful to reclaim your variable space in memory after done using the object
  12. Set MyFSO = nothing
  13. End Sub


More in depth information should be gleaned from the MSDN Library: What Can You Do With Visual Basic: Processing Drives, Folders, and Files
Reputation Points: 49
Solved Threads: 44
Posting Pro in Training
hkdani is offline Offline
426 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: How to make a Instal Guide/wizard??
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: PDF Print Macro - How???





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC