Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Location
    London,UK
    Posts
    54

    Unanswered: create and save csv

    Code:
    Private Sub cmdExportCsv_Click()
        Dim filename
        Dim sqlString
        'create fso
        Set fs2 = CreateObject("Scripting.FileSystemObject")
        'set the fso to create a new file of users choice
        Set exportfile = fs2.createtextfile(DBSpeichern(CurDir & "\*.csv"), True)
        'begin modernity algorithm again only adding data to export file at same time
        sqlString = "SELECT propfixed.propref,decentHomesRawData.propref,uprn,kitchenSpaceAndLayout,kitchenRenewalYear,bathroomSpaceAndLayout,bathroomRenewalYear,windowType,propfixed.propref,houseno,proadd1,proadd2,proadd3,proadd4,propstcde " & _
                            "FROM decentHomesRawData,propfixed " & _
                            "WHERE decentHomesRawData.propref = propfixed.propref"
        createRecordSet (sqlString)
        exportfile.writeline ("propref,uprn,houseno,proadd1,proadd2,proadd3,proadd4,propstcde,kitchenSpaceAndLayout,kitchenRenewalYear,bathroomSpaceAndLayout,bathroomRenewalYear,windowType")
        rs.MoveFirst
        Do Until rs.EOF
            exportfile.write rs.Fields("propfixed.propref") & "," & rs.Fields("uprn") & "," & rs.Fields("houseno") & "," & rs.Fields("proadd1") & "," & rs.Fields("proadd2") & "," & rs.Fields("proadd3") & "," & rs.Fields("proadd4") & "," & rs.Fields("propstcde") & "," & rs.Fields("kitchenSpaceAndLayout") & "," & rs.Fields("kitchenRenewalYear") & "," & rs.Fields("bathroomSpaceAndLayout") & "," & rs.Fields("bathroomRenewalYear") & "," & rs.Fields("windowType")

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Question Re: create and save csv

    Originally posted by tinkxtheminx
    Code:
    Private Sub cmdExportCsv_Click()
        Dim filename
        Dim sqlString
        'create fso
        Set fs2 = CreateObject("Scripting.FileSystemObject")
        'set the fso to create a new file of users choice
        Set exportfile = fs2.createtextfile(DBSpeichern(CurDir & "\*.csv"), True)
        'begin modernity algorithm again only adding data to export file at same time
        sqlString = "SELECT propfixed.propref,decentHomesRawData.propref,uprn,kitchenSpaceAndLayout,kitchenRenewalYear,bathroomSpaceAndLayout,bathroomRenewalYear,windowType,propfixed.propref,houseno,proadd1,proadd2,proadd3,proadd4,propstcde " & _
                            "FROM decentHomesRawData,propfixed " & _
                            "WHERE decentHomesRawData.propref = propfixed.propref"
        createRecordSet (sqlString)
        exportfile.writeline ("propref,uprn,houseno,proadd1,proadd2,proadd3,proadd4,propstcde,kitchenSpaceAndLayout,kitchenRenewalYear,bathroomSpaceAndLayout,bathroomRenewalYear,windowType")
        rs.MoveFirst
        Do Until rs.EOF
            exportfile.write rs.Fields("propfixed.propref") & "," & rs.Fields("uprn") & "," & rs.Fields("houseno") & "," & rs.Fields("proadd1") & "," & rs.Fields("proadd2") & "," & rs.Fields("proadd3") & "," & rs.Fields("proadd4") & "," & rs.Fields("propstcde") & "," & rs.Fields("kitchenSpaceAndLayout") & "," & rs.Fields("kitchenRenewalYear") & "," & rs.Fields("bathroomSpaceAndLayout") & "," & rs.Fields("bathroomRenewalYear") & "," & rs.Fields("windowType")
    Does ScriptingFileSystem run under Access97? What kind or Refrences do I need?

    Your fs2 is nor decleared in your function?
    Thanks

  3. #3
    Join Date
    Aug 2003
    Location
    London,UK
    Posts
    54

    dunno

    dunno never really used access 97

Posting Permissions

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