I have done something similar in VB so I know this (can) work...
But I get an error back from Python at cmdInsert.Execute() that I am
Not sure I understand...  :/

Can anyone elaborate for me?  (or see an obvious problem)

Thanks!

Mike J.

============================== error message
============================

******************************
** BEGIN CATALOG GENERATION **
******************************
c:\catalog already exists.
continuing...
begin extracting works on Thu Jun 13 00:15:08 2002
Traceback (most recent call last):
  File "C:\Documents and Settings\mjessop\My Documents\Python
Development\Catalog\BuildCatalog.py", line 1306, in
populateWorksFromOracle()
  File "C:\Documents and Settings\mjessop\My Documents\Python
Development\Catalog\BuildCatalog.py", line 330, in
populateWorksFromOracle
    cmdInsert.Execute()
  File "<COMObject ADODB.Command>", line 2, in Execute
  File "C:\Python22\Lib\site-packages\win32com\client\dynamic.py", line
237, in
_ApplyTypes_
    result = apply(self._oleobj_.InvokeTypes, (dispid, LCID, wFlags,
retType, argTypes) + args)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0,
'Microsoft OLE DB Provider for ODBC Drivers', 'Multiple-step OLE DB
operation generated errors. Check each OLE DB status value, if
available. No work was done.', None, 0, -2147217887), None)

========================= code segment ==========================

    if status == SUCCESS:
        #   Generate our dynamic insert statement, create new
        #   ADODB connection and command objects which we'll
        #   use to connect to our access database (via the
        #   CatalogMDB DSN object)...

        sql = "insert into works (title, wrk_inst, trs_inst, aas_inst) "
+ \
              "values (?, ?, ?, ?)"
    
        cnnTempDB = win32com.client.Dispatch('ADODB.Connection')
        cmdInsert = win32com.client.Dispatch('ADODB.Command')
        
        cnnTempDB.Open(TEMP_DB)
        cmdInsert.ActiveConnection = cnnTempDB
        cmdInsert.CommandType = 1
        cmdInsert.CommandText = sql
        
        if not rstOracle.EOF:
            #   Let's bind up our dynamic sql statement...
            
 
cmdInsert.Parameters.Append(cmdInsert.CreateParameter("title", 200, 1,
len(rstOracle.Fields("title").Value), rstOracle.Fields("title").Value))
 
cmdInsert.Parameters.Append(cmdInsert.CreateParameter("wrk_inst", 131,
1, 4, rstOracle.Fields("wrk_inst").Value))
 
cmdInsert.Parameters.Append(cmdInsert.CreateParameter("trs_inst", 131,
1, 4, rstOracle.Fields("trs_inst").Value))
 
cmdInsert.Parameters.Append(cmdInsert.CreateParameter("aas_inst", 131,
1, 4, rstOracle.Fields("aas_inst").Value))
            cmdInsert.Execute()
            rstOracle.MoveNext()

_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython

Reply via email to