Discussion:
[python-win32] Transfer Access 2010 query results to python script for ArcGIS geoprocessing actions
Access Newbie
2015-04-15 15:53:08 UTC
Permalink
Is it possible to transfer the results of an Access 2010 query (accdb
extension) to a python script with the click of a button? Information will
be used as variables within the script.

Prefer to click button from Access data entry form to execute script but it
can be from another GUI if necessary.

Data getting transferred (anywhere from 20-50 fields) will be contact
information, shapefile name and directory location, and arcpy parameters
such as buffer distances for various geoprocessing applications. Script can
be run from the command line and does not require ArcMap to be open to run.

I am not sure where to begin and am not really a programmer so the really
complicated stuff will probably confuse me unless explained in easy to
understand language.

Thank you for any and all guidance
Vernon D. Cole
2015-04-15 16:41:22 UTC
Permalink
You will probably need the help of an experienced Python programmer to do
what you wish, but the tools are all available, and you came to the correct
place to find them. [ -- almost -- Normally, adodbapi is included in
pywin32, but Mark and I had a communications failure with the current
release, so you will have to download from
http://sourceforge.net/projects/adodbapi until the next pywin32 release.]

The good news is that using the adodbapi module, you can read and write
data from from an Access database using SQL, almost as if it were on a real
database server -- and you do not need to have Access on your computer to
do it.

The bad news is that some Geoprocessing tools you may want for your
application only work if you use the Python which is built in to ArcGis --
and it might be a bit tricky to install pywin32 in it -- since they install
it in a non-standard location.

The better news is that there are also third-party libraries of
Geoprocessing tools for Python that can used outside of ArcGis that might
do what you need, assuming that your Geographic database is served on a
capable server like PostgreSQL (PostGIS) or Microsoft SQL Server (both of
which are also supported by adodbapi.)

Feel free to contact me offline if you want some references.
--
Vernon Cole
Post by Access Newbie
Is it possible to transfer the results of an Access 2010 query (accdb
extension) to a python script with the click of a button? Information will
be used as variables within the script.
Prefer to click button from Access data entry form to execute script but
it can be from another GUI if necessary.
Data getting transferred (anywhere from 20-50 fields) will be contact
information, shapefile name and directory location, and arcpy parameters
such as buffer distances for various geoprocessing applications. Script can
be run from the command line and does not require ArcMap to be open to run.
I am not sure where to begin and am not really a programmer so the really
complicated stuff will probably confuse me unless explained in easy to
understand language.
Thank you for any and all guidance
_______________________________________________
python-win32 mailing list
https://mail.python.org/mailman/listinfo/python-win32
Tim Roberts
2015-04-15 17:54:49 UTC
Permalink
Post by Access Newbie
Is it possible to transfer the results of an Access 2010 query (accdb
extension) to a python script with the click of a button? Information
will be used as variables within the script.
Prefer to click button from Access data entry form to execute script
but it can be from another GUI if necessary.
Data getting transferred (anywhere from 20-50 fields) will be contact
information, shapefile name and directory location, and arcpy
parameters such as buffer distances for various geoprocessing
applications. Script can be run from the command line and does not
require ArcMap to be open to run.
Well, wait a minute. You have described several completely different
approaches here. Are you talking about something that runs inside of
Access, or a GUI app that talks directly to the database, or a
command-line app that pulls from the database?

In order to display an Access form, the Access application has to be
running. In that case, buttons can call Visual Basic scripts, and it
may be easier to do what you want entirely in Visual Basic.

There are several ways for a standalone application to talk to an Access
database, assuming Access is installed. However, if Access already has
the database open, you can't necessarily open it in another application
at the same time.
--
Tim Roberts, ***@probo.com
Providenza & Boekelheide, Inc.
Loading...