<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic RecordSet Export to csv in ArcPad Questions</title>
    <link>https://community.esri.com/t5/arcpad-questions/recordset-export-to-csv/m-p/422335#M3052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the Recordset Export method to export a shapefile's .dbf to a .csv file. The .csv file gets created, but then ArcPad crashes...and the .csv file is empty. Here is my code, which I call OnSetActive of a page. If I comment out the pRS.Export line, no .csv file is created and ArcPad does not crash. But I need a .csv file with the data as my output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone troubleshoot this or perhaps share a snippet of code where they were able to successfully use the Recordset's Export method, so I can see what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub CreateCSV()&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ create the recordset object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pRS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRS = Application.CreateAppObject("RecordSet")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ create a shapefile and add a field&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pRS.Create ("Y:\Prep\ArcPadPrep\DATACHECKS\Testing.shp", apShapePoint)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pRS.Fields.Append ("LfNodes", apFieldNumeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ Open new shapefile, add a feature, set the value of the field LfNode to 1, update and close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Open "Y:\Prep\ArcPadPrep\DATACHECKS\Testing.shp",2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.AddNew&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Fields("LfNodes").Value = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Update&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Close&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ export Testing.dbf to Testing.csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Export "Y:\Prep\ArcPadPrep\DATACHECKS\Testing.csv",-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ clean up&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRS = Nothing&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jun 2016 19:24:02 GMT</pubDate>
    <dc:creator>IngridHogle</dc:creator>
    <dc:date>2016-06-23T19:24:02Z</dc:date>
    <item>
      <title>RecordSet Export to csv</title>
      <link>https://community.esri.com/t5/arcpad-questions/recordset-export-to-csv/m-p/422335#M3052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the Recordset Export method to export a shapefile's .dbf to a .csv file. The .csv file gets created, but then ArcPad crashes...and the .csv file is empty. Here is my code, which I call OnSetActive of a page. If I comment out the pRS.Export line, no .csv file is created and ArcPad does not crash. But I need a .csv file with the data as my output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone troubleshoot this or perhaps share a snippet of code where they were able to successfully use the Recordset's Export method, so I can see what I am doing wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub CreateCSV()&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ create the recordset object&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pRS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRS = Application.CreateAppObject("RecordSet")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ create a shapefile and add a field&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pRS.Create ("Y:\Prep\ArcPadPrep\DATACHECKS\Testing.shp", apShapePoint)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call pRS.Fields.Append ("LfNodes", apFieldNumeric)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ Open new shapefile, add a feature, set the value of the field LfNode to 1, update and close&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Open "Y:\Prep\ArcPadPrep\DATACHECKS\Testing.shp",2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.AddNew&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Fields("LfNodes").Value = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Update&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Close&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ export Testing.dbf to Testing.csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRS.Export "Y:\Prep\ArcPadPrep\DATACHECKS\Testing.csv",-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '++ clean up&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pRS = Nothing&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 19:24:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/recordset-export-to-csv/m-p/422335#M3052</guid>
      <dc:creator>IngridHogle</dc:creator>
      <dc:date>2016-06-23T19:24:02Z</dc:date>
    </item>
    <item>
      <title>Re: RecordSet Export to csv</title>
      <link>https://community.esri.com/t5/arcpad-questions/recordset-export-to-csv/m-p/422336#M3053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't know if this will help, but maybe try putting ( )&amp;nbsp; around the args for th pRS.Open and pRS.Export&amp;nbsp; ??&amp;nbsp; just a quick observations ....nothing tested.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 19:40:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcpad-questions/recordset-export-to-csv/m-p/422336#M3053</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-06-23T19:40:24Z</dc:date>
    </item>
  </channel>
</rss>

