We are trying to determine out how many records are in a FoxPro table,
preferably, without first performing an execute statement.
In FoxPro, it would be something similar to using recount() or alen().
We are using Dabo, Python 2.7 and pyodbc.
I've tried cursor.rowcount after an execute method and it just returns a
-1. Any suggestions?
Current code:
dialog = wx.FileDialog(None, message='Select Table...', \
wildcard='Table/DBF|*.dbf', \
style=wx.OPEN)
dialog.ShowModal()
currdir = dialog.GetDirectory()
cnxn = pyodbc.connect(DRIVER='{Microsoft FoxPro VFP Driver
(*.dbf)}', \
SourceType='DBF', \
SourceDB=currdir)
dbf = cnxn.cursor()
currdbf =
dialog.GetFilename().replace('.dbf','').replace('.DBF','')
columninfo = dbf.columns(table='%s' % (currdbf,)).fetchall()
for row in columninfo:
# print column names in a selected table
print row.column_name
Mike Coop
Data Analyst III
Kemper Preferred
12926 Gran Bay Parkway West, Jacksonville, FL 32258
904.245.5949
[email protected]
kemper.com
CONFIDENTIALITY NOTICE: This communication may contain confidential information
intended only for the addressee(s). If you received this communication in
error, please notify the sender and delete it from your system.
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/ea3f09e331105045bee09923c85d8d2630cf3...@kahjaxex1.unitrininc.unitrin.org