persiste problema con consulta a dbf
Carlos Edurado Sotelo Pinto
csotelop en yahoo.es
Jue Ene 13 02:13:49 CET 2005
hola lista
probe cambiando el odbc por al adodbapi... y segui con el mismo error:
le envio el codigo completo de una secuencia que realize en un a mauiqna
con window 98, el detalle es que funciono en win2000 y win xp
>>> StringDBF = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Sisges\Desarrollo\dbf;Extended Properties=dBASE IV;User
ID=Admin;Password="
>>> StringDBF
'Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Sisges\\Desarrollo\\dbf;Extended Properties=dBASE IV;User
ID=Admin;Password='
>>> import adodbapi
>>> ADOConn = adodbapi.connect(StringDBF)
>>> ADOCurr=ADOConn.cursor()
>>> dir(ADOCurr)
['__doc__', '__init__', '__module__', '_fetch',
'_makeDescriptionFromRS', '_raiseCursorError',
'_returnADOCommandParameters', 'arraysize', 'callproc', 'close', 'conn',
'description', 'errorhandler', 'execute', 'executeHelper',
'executemany', 'fetchall', 'fetchmany', 'fetchone', 'messages',
'nextset', 'rowcount', 'rs', 'setinputsizes', 'setoutputsize']
>>> SQLQuery = 'UPDATE panexo set valida = "T"'
>>> ADOCurr.execute(SQLQuery)
Traceback (most recent call last):
File "<pyshell#7>", line 1, in ?
ADOCurr.execute(SQLQuery)
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 592,
in execute
self.executeHelper(operation,0,parameters)
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 552,
in executeHelper
self._raiseCursorError(DatabaseError,tracebackhistory)
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 407,
in _raiseCursorError
eh(self.conn,self,errorclass,errorvalue)
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 38, in
standardErrorHandler
raise errorclass(errorvalue)
DatabaseError:
-----------
Strategy 1: Traceback:Traceback (most recent call last):
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 540,
in executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 2, in Execute
File "C:\PYTHON23\Lib\site-packages\win32com\client\dynamic.py", line
251, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, 'Microsoft
JET Database Engine', 'La operaci\xf3n debe usar una consulta
actualizable.', None, 5003073, -2147467259), None)
-----------
Strategy 2: Traceback:Traceback (most recent call last):
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 540,
in executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 2, in Execute
File "C:\PYTHON23\Lib\site-packages\win32com\client\dynamic.py", line
251, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, 'Microsoft
JET Database Engine', 'La operaci\xf3n debe usar una consulta
actualizable.', None, 5003073, -2147467259), None)
-----------
Strategy 3: Traceback:Traceback (most recent call last):
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 540,
in executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 2, in Execute
File "C:\PYTHON23\Lib\site-packages\win32com\client\dynamic.py", line
251, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, 'Microsoft
JET Database Engine', 'La operaci\xf3n debe usar una consulta
actualizable.', None, 5003073, -2147467259), None)
-----------
Strategy 4: Traceback:Traceback (most recent call last):
File "C:\PYTHON23\lib\site-packages\adodbapi\adodbapi.py", line 540,
in executeHelper
adoRetVal=self.cmd.Execute()
File "<COMObject ADODB.Command>", line 2, in Execute
File "C:\PYTHON23\Lib\site-packages\win32com\client\dynamic.py", line
251, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType,
argTypes) + args)
com_error: (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, 'Microsoft
JET Database Engine', 'La operaci\xf3n debe usar una consulta
actualizable.', None, 5003073, -2147467259), None)
--- ADODBAPI on command:UPDATE panexo set valida = "T" with parameters: None
>>>
Más información sobre la lista de distribución Python-es