Can I use the FileSystemsObject in Access or VB?

Results 1 to 2 of 2

Thread: Can I use the FileSystemsObject in Access or VB?

  1. #1
    Join Date
    Dec 1969

    Default Can I use the FileSystemsObject in Access or VB?

    I need to be able to open a recordset, change the data a little and then create a text file of that data. I can do this in ASP, but I would rather not waste my servers&#039 resources. I assume I could do this in Access or VB, but am pretty new to coding in those environments. Here&#039s how I would do it in ASP:<BR>.<BR>.<BR>strFileText=""<BR>set rs=conn.execute("select * from tblWhatever")<BR>do until rs.eof<BR>.<BR>strFileText=strFileText & "name:" & rs("name") & vbcrlf<BR>.<BR>rs.movenext<BR>loop<BR><BR>set fso=server.createobject("scripting.filesystemobjec t")<BR>set newfile=fso.createtextfile("textfile.txt")<BR>newf ile.write strfiletext<BR>newfile.close<BR>.<BR>.<BR>How would I accomplish the same thing in VB or Access? <BR>If you know of any good websites that help with moving from VBScript to VB or VBA, I would appreciate it.<BR>Thanks. <BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Can I use the FileSystemsObject in Access or V

    VBS is a subset of VB and the code you showed would run in VB with NO changes. It looks to me as though you can also access filesystemobjects in Access modules, but I think it would be more trouble than it&#039s worth. I&#039d stick with VB.<BR><BR>If you download the documentation for VBS from (and then follow the links), it includes a section on things that are supported in VBA but not VBS and vice versa.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts