Opening a DB Connection
Rich Shepard <[email protected]>
| Newsgroups | gmane.comp.python.db.pysqlite.user |
|---|---|
| Message-ID | <[email protected]> |
In both the web site documentation and Mike Owens' excellent book (except
for the index), the examples of opening a database connect are:
con = sqlite3.connect("name.db")
and there is no check for an error condition. As a long time C coder, and
a newcomer to python, I feel uncomfortable assuming that the connection will
be made without error when the application runs.
Is my worry misplaced? If not, what is the desired way of wrapping the
statement in a test for successful completion?
Thanks,
Rich
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863