[IronPython] Users Digest, Vol 65, Issue 24

Lukas Cenovsky cenovsky at bakalari.cz
Thu Dec 17 08:36:23 PST 2009


Perez, Justin wrote:
> Hello all,
>
> I have been following the mailing list quite vigorously and have learned
> much.  I work with python in Geographic Information Systems.  I poked
> around Shri Borde's example of using IronPython to work with Excel.  I
> have the need to go through a directory and convert each .dbf file to a
> .csv file.  I am thinking this may be a good intro into IronPython to do
> this.  However, I am needing to get the solution quickly as this is just
> the last part of my code (mostly dealing with geo processing code).
> Does anyone have an idea as to how quickly I could get this running.
> Otherwise I am thinking to use the win32all module and hopefully that
> will be painless for a newcomer like myself.  Is IronPython ready to be
> used in this context?  Thanks.
>
> Justin Perez
> Energy Transfer
> Houston
> Pipeline Integrity GIS
> 281.714.2382
>   
I would go with System.Data.OleDb:

con = System.Data.OleDb.OleDbConnection("Provider=vfpoledb;Data 
Source=<path>")

The con is then standard connection object and you use it as it was SQL. 
The file name without extension is name of the table. If you need info 
about the structure, just execute command 'select * from table' and then 
check reader.GetSchemaTable()

--
-- Lukáš



More information about the Users mailing list