oi.dZdZdezZddlZddlZddlZddlZddlZddlm Z m Z m Z  eejdZn #dZYnxYwer ee ddlZddlZdd lmZn"#e$rddlZejd ed YnwxYwd ZddlmZdZdZe jZ e j!Z"e j#Z$ddZ%dZ&GddZ'GddZ(e)dkre j*edzdS)aadodbapi - A python DB API 2.0 (PEP 249) interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund, versions 2.1 and later by Vernon Cole * https://sourceforge.net/projects/pywin32 * https://github.com/mhammond/pywin32 * https://sourceforge.net/projects/adodbapi This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA django adaptations and refactoring by Adam Vandenberg DB-API 2.0 specification: https://peps.python.org/pep-0249/ This module source should run correctly in CPython versions 2.7 and later, or CPython 3.4 or later. z2.6.2.0z adodbapi vN) ado_constsapibaseprocess_connect_stringADODBAPI_VERBOSEF)Dispatchz&pywin32 package required for adodbapi.) stacklevelc||SN)objindexs AC:\PYTHON\Scheduler\python\Lib\site-packages\adodbapi/adodbapi.pygetIndexedValuer:s 3u::)Mappingc tjtd}n#tjdxYw|S)NzADODB.Connectionz7Windows COM Error: Dispatch('ADODB.Connection') failed.) pythoncom CoInitializerapiInterfaceError)cs rmake_COM_connecterrBsN    ' ( (  E    Hs"%;ct}tj||d} |||S#t$r$}d|jz}t j||d}~wwxYw)aConnect to a database. call using: :connection_string -- An ADODB formatted connection string, see: * https://www.connectionstrings.com * https://www.codeguru.com/dotnet/whats-in-an-ado-connection-string/ * https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/connection-strings :timeout -- A command timeout value, in seconds (default 30 seconds) Tz Error opening connection to "%s"N) Connectionrprocessconnect Exceptionconnection_stringrOperationalError)argskwargscoemessages rrrMs| B # +D&$ ? ?F/ 6 ///4r7KK"1g.../s= A+A&&A+c |r d|D}n d|D}dd|zdzS#YdSxYw)zeFormat a collection of ADO Command Parameters. Used by error reporting in _execute_command. cg|]}d|jdtj|jdtj|jt|jdzd|jd|j d|j d|j S)Name: , Dir.: , Type:  (unknown type), Size: , Value: "", Precision: , NumericScale: ) Nameadc directions Direction adTypeNamesgetTypestrSizeValue Precision NumericScale.0ps r z%format_parameters..s   AFFFN1;///O''AF >O0OPPPPFFFGGGKKKNN    rcg|]w}d|jdtj|jdtj|jt|jdzd|jd|j d|j  xS)r)r*r+r,r-z , Precision: r0) r1r2r3r4r5r6r7r8r9r;r<r=s rr@z%format_parameters..s   AFFFN1;///O''AF >O0OPPPPFFFKKKNN   r[ ]z[])join) ADOparameters show_valuedescs rformat_parametersrIxs}     '   DD  '   DTYYt__$s**tts58=c4|tjvr+t||_||dSt |t r\t|}|tjvr'|rt||j}|d||_ n||_ |dkr ||_dSdSt |tj r||_ | d}t| d}||_ |dkr d|_dS|dkr(| |_|j |jkr|j|_ dSdSd|_||z|_ dSt|t jvrh|r/|tjvr!t ||_ dSt |}||_ t||_dS|t*jkrt*j|_d|_ dS||_ dS)z>Configure the given ADO Parameter 'p' with the Python 'value'.Nrr r)radoBinaryTypeslenr9 AppendChunk isinstancer8adoStringTypesminr:decimalDecimalas_tupler;r<type dateconvertertypesadoDateTimeTypesCOMDateDateObjectToIsoFormatStringr2adEmpty adIntegerr7)r?valueadotypesettings_knownlengthexponent digit_countss r_configure_parameterrcs#$$$U e E3  +U c( ( ( -VQV,,GVGnAGGAG A::AFFF : E7? + + >>##A&%..**1-.. ! q==ANNN \\&YAN{Q^++n ,+AN%0AKKK e + + +  g)===#++E22AGGG99%@@AAGVVAFFF CK   M rc<eZdZejZejZejZejZejZej Z ej Z ej Z ej Z ej Z ejZejZedZdZefdZdZdZdZdZdZd Zd Zd Zd Zd ZdZdZ dZ!dZ"dZ#dZ$dS)rctS)z;Return a reference to the DBAPI module for this Connection.)rselfs rdbapizConnection.dbapis  rcd|_tj|_d|_d|_t jttf|_ d|_ d|_ d|_ d|_ d|_dS)NFr) connectorr paramstylesupportsTransactionsr weakrefWeakValueDictionaryintCursorcursors dbms_name dbms_version errorhandlertransaction_level _autocommitrfs r__init__zConnection.__init__sh.$)!!#23;?AA  !" rctdkrtd| |d|z|_n2#t$r%}|t dYd}~nd}~wwxYw|dd|_|dtj |_ ||_ trttd|jd ||_ |j|j _|j|j _|j |j _ |j n=#t$j$r+|t$jd |jzYnwxYw t+|j jd jd krd |_n#t2j$rYnwxYwt+|j jdj|_ t+|j jdj|_n#t2j$rYnwxYwt:|j _|jr_t>|j _ tC|dd|_"|j"s|j #|_$nd |_"d|vr |d|_%g|_&tr!tdtO|zdSdS)N zkwargs=r z1Python string format error in connection string->timeoutmodez attempting: ""zADO error trying to Open=%szTransaction DDLrTz DBMS Namez DBMS Version autocommitFrlzadodbapi New connection at %X)(verboseprintr r_raiseConnectionErrorKeyErrorr6r{r2 adModeUnknownr}r#versionrkConnectionTimeoutConnectionStringModeOpenrError DatabaseErrorr Propertiesr:rm pywintypes com_errorrsrtdefaultCursorLocationCursorLocationdefaultIsolationLevelIsolationLevelboolrw BeginTransrvrlmessagesid)rgr#connection_makerr%s rrzConnection.connects  Q;; &F&& ' ' ' *+f4  " "     & &M         zz)R00 JJvs'899   M 777D4J4J4JK L L L))+++/<(*.*@'"i  N   ! ! ! !y     & &!-0FF        t~8:KLLRVWWW,0)#    D ()BKPPV  /)>!!   #    D (=%  $ $,ADN )#FJJ|U$C$CDDD # N--//& $D  6 ! !$\2DO  > 1BtHH< = = = = = > >sJ0 AAAD,,7E&%E&**FF'&F'$G44HHcL|j}| tj}||d||dSr )rurstandardErrorHandlerrg errorclass errorvalueehs rrz Connection._raiseConnectionError.s3   :)B 4z:.....rc|jdS|js)|jr" |jn#YnxYw|jt r!t dt|zdSdS)zfclose the underlying ADO Connection object, rolling it back first if it supports transactions.Nz adodbapi Closed connection at %X)rkrwrv RollbackTransCloserrrrfs r_closeAdoConnectionzConnection._closeAdoConnection4s > ! F % N002222D   A 4r$xx? @ @ @ @ @ A As37ct|jddD]}|dg|_ |n[#t $rN}|tj dtj dYd}~nd}~wwxYwd|_ dS)aEClose the connection now (rather than whenever __del__ is called). The connection will be unusable from this point forward; an Error (or subclass) exception will be raised if any operation is attempted with the connection. The same applies to all cursor objects trying to use the connection. NT) dont_tell_merr) listrrvaluescloserrrrsysexc_infork)rgcrsrr%s rrzConnection.closeCs,,..// AA  * *D JJDJ ) ) ) )  M  $ $ & & & & M M M  & &s|~~a'8#,..:K L L L L L L L L MsA%% B=/AB88B=cg|_|jsdS |j|_t dkrt dt|z|js9|jj tj zs"|j |_dSdSdS#t$r+}|tj|Yd}~dSd}~wwxYw)aHCommit any pending transaction to the database. Note that if the database supports an auto-commit feature, this must be initially off. An interface method may be provided to turn it back on. Database modules that do not support transactions should implement this method with void functionality. Nrzcommit done on connection at %X)rrmrk CommitTransrvrrrrw Attributesr2adXactAbortRetainingrrrrProgrammingErrorrgr%s rcommitzConnection.commitXs (  F @%)^%?%?%A%AD "{{7"T((BCCC  EN-0HH E*.)B)B)D)D&&& E E E E @ @ @  & &s';Q ? ? ? ? ? ? ? ? ? @sBB C( CCcg|_|jr |j|_tdkrt dt |z|js@|jjtj zs)|js$|j |_dSdSdSdS#t$r+}| tj|Yd}~dSd}~wwxYwdS)aIn case a database does provide transactions this method causes the the database to roll back to the start of any pending transaction. Closing a connection without committing the changes first will cause an implicit rollback to be performed. If the database does not support the functionality required by the method, the interface should throw an exception in case the method is used. The preferred approach is to not implement the method and thus have Python generate an AttributeError in case the method is requested. This allows the programmer to check for database capabilities using the standard hasattr() function. For some dynamically configured interfaces it may not be appropriate to require dynamically making the method available. These interfaces should then raise a NotSupportedError to indicate the non-ability to perform the roll back when the method is invoked. rz!rollback done on connection at %XN)rrvrkrrrrrwrr2rrrrrrrs r _rollbackzConnection._rollbackrs   " D D)-)E)E)G)G&Q;;=4HIII'MN-0HHM  1M151J1J1L1L...MMMM MM D D D**3+?CCCCCCCCC D D DsB B%% C/ CCc|dkrO|jrFt|dt| |n#YnxYwdS|dkr?|t jvr0|t jd|dt jn|dkrtj |}t|||dS)Nrrwrlz paramstyle=z not in:variantConversions) rmobject __setattr__rrraccepted_paramstylesrNotSupportedErrorcopy)rgnamer\s rrzConnection.__setattr__s <  ( ""4U DDDNN$$$$D F \ ! !C444**)O%OO33KOO) ) )Ie$$E4u-----s A Ac|dkr|jr|jStd|dkr|jStd|z)Nrollbackz,this data provider does not support Rollbackrz2no such attribute in ADO connection object as="%s")rmrAttributeErrorrwrgitems r __getattr__zConnection.__getattr__sb J  ( UN%%STTT \ ! !# # DtK rc2g|_t|}|S)z0Return a new Cursor Object using the connection.)rrq)rgrs rcursorzConnection.cursors 4LLrc8t|}||j|<dS)z3message from a new cursor proclaiming its existenceN)rrr)rgroids r _i_am_herezConnection._i_am_hereshh  SrcB |jt|=dS#YdSxYw)z %^* . .AJ##D)).Ug-=-=----.>  rcN |n#YnxYwd|_dSr )rrkrfs r__del__zConnection.__del__s5   $ $ & & & &  Dsc|Sr r rfs r __enter__zConnection.__enter__s rc^|r|dS|dSr )rrrgexc_typeexc_valexc_tbs r__exit__zConnection.__exit__s1   NN      KKMMMMMrc|jd}g}|jsJt|jdj}||||jJ~|S)N TABLE_NAME)rk OpenSchemaEOFrFieldsr:appendMoveNext)rgschematablesrs rget_table_nameszConnection.get_table_namessr**2..* "6=,??ED MM$    OO   *   rN)%__name__ __module__ __qualname__rWarningrr DataErrorrr!r InternalErrorrrFetchFailedErrorrpropertyrhrxrrrrrrrrrrrrrrrrrrr rrrrskG IE'N I%M+'N%M-++kG X ! ! !0B7>7>7>7>r/// A A A*@@@4 D D DD...(" !!!  0 0 0!!!      rrceZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd#dZdZejfdZdZdZdZd$dZdZd#dZd$dZdZd$dZdZd$dZdZdZ dZ!d$d Z"d!Z#e$e#ddd"Z%dS)%rqcd|_d|_g|_||_|j|_g|_d|_d|_g|_i|_ d|_ d|_ d|_ |j |_ d|_||t r;t#dt$t'|t'|jfzdSdS)NFrrz%s New cursor at %X on conn %X)command _ado_preparedr connectionrl_parameter_namesrecordset_is_remoters converters columnNamesnumberOfColumns _descriptionrowcountru arraysizerrrrr)rgrs rrxzCursor.__init__!s " $$/ "#(    &3d###   0BtHHb&9&9:;       rc,t|jdSr )iterfetchonerfs r__iter__zCursor.__iter__8sDM4(((rc0||_d|_d|_dS)Nsetup)rrr)rg operations rpreparezCursor.prepare;s   $rc@|}|r|Str )r  StopIteration)rgrs r__next__zCursor.__next__@s" MMOO  Hrc|S)8Allow database cursors to be used with context managers.r rfs rrzCursor.__enter__Fs rc.|dS)rNrrs rrzCursor.__exit__Js rcV|j}| tj}||j|||dSr )rurrrrs r_raiseCursorErrorzCursor._raiseCursorErrorNs5   :)B 4?D*j99999rcg|_i|_d|_||jtjkrd|_d|_dS||_tj |_ |j j |_ |j j}n#t$rtj}YnwxYwt!|jD]}t#|jj |} |j||jn8#t($r+|tjd|jzYnwxYw||j|j<dS)Nrz"Data column of Unknown ADO type=%s)rrrStater2 adStateClosedrrr RS_WIN_32recordset_formatrrrrrrangerrr7rrrr1lower)rg recordsetvarConifs rbuild_column_infozCursor.build_column_infoTsj   9?c6G#G#GDG#$D F # (/5 ,_7FF , , ,+FFF ,t+,, 1 1A22A &&16N   &&%'Kaf'T 01D QV\\^^ , , 1 1s$' A44B  B %C''2DDc |j d|_dSg}t|jD]}t |jj|}|jjs |jjrd}n|j}t|j tj z}| |j|j||j|j|j|f||_dSr )rrr rrrrBOF ActualSizerrr2adFldMayBeNullrr1r7 DefinedSizer;r<)rgrHr$r% display_sizenull_oks r_makeDescriptionFromRSzCursor._makeDescriptionFromRSqs 7? $D  Ft+,,  A22Aw{ ,dgk ,#  !| 1<#*<<==G KKFF MKN    !rcF|js||jSr )rr.rfs rget_descriptionzCursor.get_descriptions(  *  ' ' ) ) )  rcp|dkr|St||dS)N description)r0r__getattribute__rs rrzCursor.__getattr__sF = '')) ) $     rcj|j|t|tr |j|}d|ddtj|dt|ddzd|dd |d d |d d |dd|d}|S)z-Format db_api description tuple for printing.NzName= rz, Type= rr,z , DispSize= r z , IntSize= z , Precision= z , Scale= z NullOK=)r2r.rNrpr2r5r6r8)rgdrHs rformat_descriptionzCursor.format_descriptions   #  ' ' ) ) ) a   $ #A!##AaD#ad))6G*GHHHH!!!!!   rFc>|jdSg|_|jr:|jjtjkr |jd|_|s|j|d|_tr!tdt|zdSdS)zClose the cursor now (rather than whenever __del__ is called). The cursor will be unusable from this point forward; an Error (or subclass) exception will be raised if any operation is attempted with the cursor. Nzadodbapi Closed cursor at %X) rrrrr2rrrrrr)rgrs rrz Cursor.closes ? " F G  )::: GMMOOODG  O ) )       = 02d88; < < < < < = =rc@ |dS#YdSxYwr rrfs rrzCursor.__del__s(  JJLLLLL  DDscd|_g|_|j"|tjddS t d|_|jj|j_|jj |j_ ||j_ |j |j_ t|j|j_dS#|tjd|j YdSxYw)Nz ADODB.Commandz,Error creating new ADODB.Command object for )cmdrrrrrrrkActiveConnectionr{CommandTimeout CommandType commandText CommandTextrrPreparedr)rg command_types r _new_commandzCursor._new_commands ? "  " "3#5t < < < F 00DH(,(ADH %&*o&=DH ##/DH #'#3DH $T%7 8 8DH      " "!St?OSS      s A;B66*C#c *d|_d}d}trtd|jz |j\}}n#t $r}d}t|dr|t|j dzz }|d|jdt|jj dz }|j }|||Yd}~nd}~wwxYw |j|_n#||_YnxYw||dS) NrzExecuting command="%s"rjr"rCz Command: z Parameters: T) return_valuerrrBr>Executerhasattrr8r"rI Parametersrrr RecordCountrr&)rgr"countr%_messageklasss r_execute_commandzCursor._execute_commandsJ    ? *T-== > > > 4#x//11 Iuu 4 4 4Hq&!! /CKK$.. H   !$("5t<<< HO88::E  " "5( 3 3 3 3 3 3 3 3 4 "%1DMM "!DMMM y)))))s$A CBCC# C00 C;c|jSr )rrfs r get_rowcountzCursor.get_rowcounts }rc@g}t|jjD]}tdkrt d|jdt j|jdt j |j t|j dzd|j d|jd|jd |jt#j|jt"j|j }|jt jkr||_||_|||S) awith some providers, returned parameters and the .return_value are not available until after the last recordset has been read. In that case, you must coll nextset() until it returns None, then call this method to get your returned information.r zReturned=Name: r*r+r,r-r.r/r0)tupler>rKrrr1r2r3r4r5r6r7r8r9r:r;r<rconvert_to_pythonradParamReturnValue returnValuerHr)rgretLstr?pyObjects rget_returned_parameterszCursor.get_returned_parameterss tx*++ ( (A{{q{333++AFCKKBS4STTTT     ,QWc6LQV6TUUH{c444 %-!! h'''' rNcBg|_||_|tj||dt dkr(tdt|j j d| | S)atCall a stored database procedure with the given name. The sequence of parameters must contain one entry for each argument that the sproc expects. The result of the call is returned as modified copy of the input sequence. Input parameters are left untouched, output and input/output parameters replaced with possibly new values. The sproc may also provide a result set as output, which is available through the standard .fetch*() methods. Extension: A "return_value" property may be set on the cursor if the sproc defines an integer return value. )rET)sprocr z Calling Stored Proc with Params=) rrBrFr2adCmdStoredProc_buildADOparameterListrrrIr>rKrPrZ)rgprocname parameterss rcallproczCursor.callproc"s!## s':;;; ##Jd#;;; Q;; 2!$("5t<<    ++---rc|jdvrtj|\}|_nG|jdks |jdkr1t |t rtj|\}|_|S)N)formatpyformatnameddynamic)rlrchangeFormatToQmarkrrNrchangeNamedToQmarkrgrr`s r_reformat_operationzCursor._reformat_operation;sy ?4 4 4/2/Fy/Q/Q ,It,, _ ' ' Oy ( (Z G-L-L (/2/E00 ,It,rc L ||_|g}d}|r |jjtdkr:t dt |jjdt d|d}t||jjjdz kr)tj d|jjjdz zn+#tj $rtrt dYnwxYw|s|gkr)d }|r|j rt|j D]\}}t|jj|} t||||j|>#t"$rs}d |jt)j|j|j||}|tj|d |jYd}~d}~wwxYwdS|D]} t|jj|}|jt(jkr|dz }t|jj|} t|| |j|nz#t"$rm}d |jt)j|j|j| }|tj|d |jYd}~nd}~wwxYw|dz }dS|j r|j D]} || } tj| } |j| | t(j}t|| | | |jj|w#t"$rm}d |jt)j|j|j| }|tj|d |jYd}~d}~wwxYwnG|rO|jd t(j t(j}|jj||D]} d|z} tj| } |j| | t(j}t|| | | |jj|nz#t"$rm}d |jt)j|j|j| }|tj|d |jYd}~nd}~wwxYw|dz }|j!dkr d|_!dSdSdS)NFr zADO detected Params=TzProgram Parameters=rz7You must supply %d parameters for this stored procedurezADO Parameter Refresh failedrz.Error Converting Parameter {}: {}, {} <- {!r} z->z,Error Building Parameter {}: {}, {} <- {!r} z @RETURN_VALUEzp%ir)"r`r>rKRefreshrrrIrLrrrrr enumeraterrcr7rrcr1r2 ado_type_namer:rrr"r4rVpyTypeToADOTypeCreateParameter adParamInputAppendr[r)rgr`r\parameters_knownr$pm_namer?r%rNr\ parm_nameelemr]rs rr^zCursor._buildADOparameterListFsS$  J!   #++---Q;;.)$(*=tDD> >>???#' z??dh&9&?!&CCC.Q8.4q8:D 9   :8999  a J"$$A_ (%&/0E&F&F 7+DH,?CC 0 !:g#6@P )   'X'_'_ ! # 1!& 9 9 ! *7 3 ((H !22 # (/H/Haf/H/H  "",+DH,?CCK3+AAAFA /0CQ G GA 0E16CSTTTT(   'X'_'_ ! # 1!& 9 9 ! % ((H !22 # (/H/Haf/H/H Q',(2%)%: ))4"%"5d";"; H44%w0@-Qg?OPPP  H/66q9999(    O V V$%F$'$5af$=$=$%G$( !"!"%!22 # (/H/Haf/H/H ,6 H44+S]CrKrPris rexecutezCursor.executes: L ) )!W,,4//-|9,,%*"( $&D !Ow..j. --iDD    ##J/// Q;; ).tx/BDII J J J rct|_d}|||D]:}||j||jdkrd}|dkr ||jz };||_dS)zPrepare a database operation (query or command) and then execute it against all parameter sequences or mappings found in the sequence seq_of_parameters. Return values are not defined. rrN)rrrryrr)rgrseq_of_parameterstotal_recordcountparamss r executemanyzCursor.executemanys   Y' 3 3F LLv . . .}""$&! B&&!T]2!) rc|j|j"|tjddS|jjt jks|jjs |jj rtS|r|j |}n|j }|j tj krt||jz}nt|d}tj|||}|S)zFetch rows from the current recordset. limit -- Number of rows to fetch, or None (default) to fetch all rows. Nz/fetch() on closed connection or empty query setr)rrrrrrr2rr(rrGetRowsrRS_ARRAYrLrSQLrows)rglimit ado_resultsr_ fetchObjects r_fetchz Cursor._fetchs ? "dgo  " "$&W    F 7=C- - - - -66M  ,'//%00KK'//++K  !S\ 1 1K  D$88 FQ((Fk   rcRg|_|d}|r|dSdS)aFetch the next row of a query result set, returning a single sequence, or None when no more data is available. An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet. rrNrr)rgresults rr zCursor.fetchone$s1 Q  !9 trcLg|_||j}||S)aFetch the next set of rows of a query result, returning a list of tuples. An empty sequence is returned when no more rows are available. The number of rows to fetch per call is specified by the parameter. If it is not given, the cursor's arraysize determines the number of rows to be fetched. The method should try to fetch as many rows as indicated by the size parameter. If this is not possible due to the specified number of rows not being available, fewer rows may be returned. An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet. Note there are performance considerations involved with the size parameter. For optimal performance, it is usually best to use the arraysize attribute. If the size parameter is used, then it is best for it to retain the same value from one fetchmany() call to the next. )rrr)rgsizes r fetchmanyzCursor.fetchmany1s)" <>D{{4   rc8g|_|S)a}Fetch all (remaining) rows of a query result, returning them as a sequence of sequences (e.g. a list of tuples). Note that the cursor's arraysize attribute can affect the performance of this operation. An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet. rrfs rfetchallzCursor.fetchallGs {{}}rcng|_|j|j"|tjddS |j}nA#tj$r/}|tj |j Yd}~nd}~wwxYw|d}|dS| |dS)aSkip to the next available recordset, discarding any remaining rows from the current recordset. If there are no more sets, the method returns None. Otherwise, it returns a true value and subsequent calls to the fetch methods will return rows from the next result set. An Error (or subclass) exception is raised if the previous call to executeXXX() did not produce any result set or no call was issued yet. Nz1nextset() on closed connection or empty query setrT) rrrrrr! NextRecordsetrrrr"r&)rgrsTupleexcr"s rnextsetzCursor.nextsetRs ? "dgo  " "$D   4 Dg++--GG# D D D  " "3#8#( C C C C C C C C DAJ  4 y)))tsAB"%B  BcdSr r )rgsizess r setinputsizeszCursor.setinputsizesm rcdSr r )rgrcolumns r setoutputsizezCursor.setoutputsizeprrc\ |j|j}n|jd|j}n #d}YnxYw|S)Nz ,parameters=)r`rB)rgrets r _last_queryzCursor._last_queryssI &&)JJtJJ CCC s #)zreturns the last query executedFr )&rrrrxr rrrrrr&r.r0rr:rrr2 adCmdTextrFrPrRrZrarjr^ryr~rr rrrrrrrqueryr rrrqrqs.4.)))%%%  ::: 111:!!!6!!!    (====. ), (***D@....2   |||||. . . . `***$<   !!!!,   6        H[$.O P PEEErrq__main__z! cannot be run as a main program.r)+__doc__ __version__rrrQosrrnrjrr2rrrrpenvironrrrrwin32com.clientr ImportErrorwarningswarn ImportWarningrcollections.abcrrradXactReadCommittedr adUseClientrpythonDateTimeConverterrUrIrcrrqrrr rrrsO:  $  GGGGGGGGGGc"*/011GGGGG  E'NNNY(((((((YYYOOOHM:MVWXXXXXXY $#####   ///</++-- ####L222loooooooof v Qv Qv Qv Qv Qv Qv Qv Qr z # w)LL M MMsAAA&&BB