[Zope-DB] DC2Oracle external method problem
Iain Bassam
Iain.Bassam@sis.securicor.co.uk
Tue, 24 Sep 2002 15:18:50 +0100
Hi there,
I am encountering a problem trying to use DCOralce2 in an external method. I
am new to zope and python, so there may be an obvious answer that I'm
oblivious to.
I have installed DCOracle2 into ....\lib\python\Products\ZOracleDA as per
windows installation instructions and run the install script. Through zope I
can create a 'Z Oracle Database Connection' and query a database
sucessfully. I would however like to create an external method to achieve
this.
I'm using the simple example in the DCOracle2 user guide, however I'm
getting some errors.
import DCOracle2
def dbconnect(self, REQUEST):
db = DCOracle2.connect('<user>/<password>@<connect string>')
c = db.cursor()
c.execute('select * from dual')
print c.fetchall()
When I try to create the external method I get the error:
Error Type: ImportError
Error Value: No module named DCOracle2
If I copy DCOracle2.py and DCOracle2.c to .../bin/lib directory, which may
be a hack, I can create the external method, however running it causes the
following error.
Error Type: AttributeError
Error Value: 'DCOracle2' module has no attribute 'connect'
Any help as to where I'm going wrong would be greatly appreciated.
regards
Iain
**********************************************************************
The information contained in this e-mail message is intended
only for the individuals named above. If you are not the
intended recipient, you should be aware that any
dissemination, distribution, forwarding or other duplication
of this communication is strictly prohibited. The views
expressed in this e-mail are those of the individual author
and not necessarily those of
Securicor Information Systems Limited.
Prior to taking any action based upon this e-mail message
you should seek appropriate confirmation of its authenticity.
If you have received this e-mail in error, please immediately
notify the sender by using the e-mail reply facility.
**********************************************************************
_____________________________________________________________________
This message has been checked for all known viruses on behalf of Securicor Information Systems by the MessageLabs. For further information visit http://www.messagelabs.com or Email: mailsweeper.info@sis.securicor.co.uk