Adding Micorsoft Scripting Runtime dll

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2007
Posts: 47
Reputation: locsin is an unknown quantity at this point 
Solved Threads: 0
locsin locsin is offline Offline
Light Poster

Adding Micorsoft Scripting Runtime dll

 
0
  #1
Dec 11th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 218
Reputation: hkdani is an unknown quantity at this point 
Solved Threads: 24
hkdani's Avatar
hkdani hkdani is offline Offline
Posting Whiz in Training

Re: Adding Micorsoft Scripting Runtime dll

 
0
  #2
Dec 11th, 2007
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 2645 | Replies: 1
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC