FileSystemObject related problem

Results 1 to 3 of 3

Thread: FileSystemObject related problem

  1. #1
    Rob Guest

    Default FileSystemObject related problem

    I see I am not the only one! I am trying to create a CSV file to output from a query of my database. I don&#039t get any errors but I also don&#039t get a file generated either. Can anyone offer some help? Here is the code I am using<BR> <BR>If Mkfile = "chkName" Then<BR> strFile = testfile <BR><BR> Set fs = CreateObject("Scripting.FileSystemObject")<BR> Set a = fs.CreateTextFile("c: emp est.csv",True)<BR><BR> If Not objRS.EOF Then<BR> strtext = objRS(I).Name & "," <BR> a.WriteLine(strtext)<BR><BR> Do Until objRS.EOF <BR> For i = 0 To objRS.fields.Count-1<BR> strtext = objRS.fields(i) & ","<BR> a.Write(strtext)<BR> Next<BR> a.Writeline()<BR> oRS.MoveNext<BR> Loop<BR> End If<BR><BR>Also where is the "fs.CreateTextFile" command creating the file, on the server or the client computer? I have looked up references for these commands but they are not specific. Any help would be appreciated. Thanks. Rob<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: FileSystemObject related problem

    The createtextfile is creating a file on the web server.<BR><BR>I bet that is the problem.<BR><BR><BR>HTH<BR><BR>Jerry

  3. #3
    Join Date
    Dec 1969

    Default RE: FileSystemObject related problem

    You can also avoid the loops thru the individual items by using outstring = rs.getstring (2, , ",", vbnewline, "")<BR>That&#039ll give you a single output string with the fields separated by commas and rows separated by newlines.

Posting Permissions

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