[Zope-DB] Problems with ZODBC & User type
M.-A. Lemburg
mal@lemburg.com
Mon, 07 Jul 2003 13:00:05 +0200
Samir Mishra wrote:
> Hello all,
>
> I'm trying to run a query that updates a record in a table in MS SQL using
> ZODBC. When I run the query as a manager, it runs without a hitch, but when
> I try and run it as an authenticated user, I get the following error -
You should try the same using the mxODBC Zope DA. ZODBC sends
all data as strings and this can easily cause a data truncation
to happen.
The mxODBC Zope DA interfaces to the ODBC driver using native data
types whenever possible -- that's not only faster, it also avoids
truncations due to SQL limits.
> -----------------
> Site Error
> An error was encountered while publishing this resource.
>
> sql.error
>
> Sorry, a site error occurred.
>
> Traceback (innermost last):
>
> Module ZPublisher.Publish, line 150, in publish_module
> Module Products.Localizer, line 57, in new_publish
> Module ZPublisher.Publish, line 114, in publish
> Module Zope.App.startup, line 182, in zpublisher_exception_hook
> Module ZPublisher.Publish, line 98, in publish
> Module ZPublisher.mapply, line 88, in mapply
> Module ZPublisher.Publish, line 39, in call_object
> Module OFS.DTMLMethod, line 126, in __call__
> Module DocumentTemplate.DT_String, line 474, in __call__
> Module DocumentTemplate.DT_Util, line 201, in eval
> __traceback_info__: REQUEST
> Module <string>, line 2, in f
> Module Shared.DC.ZRDB.DA, line 428, in __call__
> Module Products.ZODBCDA.db, line 198, in query
>
> sql.error: ('22001', 8152, '[Microsoft][ODBC SQL Server Driver][SQL
> Server]String or binary data would be truncated.') (Also, an error occurred
> while attempting to render the standard error message.)
>
> ----------------
>
> Could someone help me with this? Not sure where the problem is, and it
> definitely works when I'm logged in as a manager.
>
> TIA.
>
> Regards,
> Samir
>
> _______________________________________________
> Zope-DB mailing list
> Zope-DB@zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
--
Marc-Andre Lemburg
eGenix.com
Professional Python Software directly from the Source (#1, Jul 07 2003)
>>> Python/Zope Products & Consulting ... http://www.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
2003-07-01: Released mxODBC.Zope.DA for FreeBSD 1.0.6 beta 1