AW: [Zope-DB] ZADODA

M.-A. Lemburg mal at egenix.com
Sat Oct 23 17:21:50 EDT 2004


juergen.hauptmann wrote:
> Hi
> 
> Thanks for your answer...
> 
> I know now the right statement for the last inserted id on MSSQL and it works...
> 
> SELECT @@IDENTITY as lastid
 >
> But I now have the problem that every insert give me this error:
> 
> Error, pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, 'ADODB.Recordset', 'Der Vorgang ist f\xfcr ein geschlossenes Objekt nicht zugelassen.', 'C:\\WINNT\\HELP\\ADO210.CHM', 0, -2146824584), None)
> 
> ANY Idea??
> 
> My ZSQL Statement:
> 
> INSERT INTO Links
>     ( 
>       Link,
>       Kommentar,
>       Student_ID,
>       EintragsDatum)
> VALUES
>     (
>       'www.orf.at',
>       'nix',
>       2755,
>       '20040707'
>      )

Just out of curiosity: do you get the same error with our mxODBC
Zope DA ?

A general hint: It is often better to centralize ID generation
using a special table in the database. This has the advantage
of allowing you to generate IDs in advance and avoids all the
problems you otherwise run into with auto-increment columns
embedded into data storage tables.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Oct 23 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Zope-DB mailing list