0

I received a an Access database too many observations to simply export as a CSV by either the export buttons in Access or copying and pasting. I tried using ogr2ogr and only get the headers in my "test.csv" file. What am I doing wrong here?

Conversely, if possible, I'd like to import the table into Oracle. Is there a method to do that straight from Access?

   ogr2ogr -update -overwrite -nlt none -progress -f CSV 'G:\Office\Heritage\KDFWR SWG Grant Work\2016_data_share\test.csv' 'G:\Office\Heritage\KDFWR SWG Grant Work\2016_data_share\Data Share\ALL_STWG.mdb'
  • Is there more than one table in the Access database? – SaultDon Aug 3 '16 at 15:45
  • Yes, there are 3. – Ian Horn Aug 3 '16 at 15:46
  • It might help to specify, in the command line, what table you want to export to the CSV. I noticed the source table was missing in your command. You can get a list using the ogrinfo utility. And if that CSV is being created on output, it might not be necessary to add the update and overwrite flags. – SaultDon Aug 3 '16 at 15:52
  • The table I want to output is in the above command line: "G:\\\\ALL_STWG.MDB " It could be that I'm just writing it incorrectly or not referencing it properly. – Ian Horn Aug 3 '16 at 17:56
  • Sorry, but is just looks like ALL_STWG.MDB is the Access database, and not the specific table that's inside that mdb. Does ogrinfo -ro -al ALL_STWG.MDB output a list of tables? – SaultDon Aug 3 '16 at 18:03
1

I think you're first attempt (example in your question) needs to be adjusted to instead provide the name of the original Access database then the table within.

A pseudo example looks like:

ogr2ogr -nlt none -progress -f CSV output.csv input.mdb source_table

And specifically for your case:

ogr2ogr -nlt none -progress -f CSV 'G:\Office\Heritage\KDFWR SWG Grant Work\2016_data_share\test.csv' 'G:\Office\Heritage\KDFWR SWG Grant Work\2016_data_share\Data Share\KSNPC ALL STWG.mdb' ALL_STWG

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.