Commits

Michael Manfre committed a5fe63d

Update ado_consts to match adodbapi.ado_consts

  • Participants
  • Parent commits 5071741
  • Branches feature-adodbapi-merge

Comments (0)

Files changed (1)

sqlserver_ado/ado_consts.py

 adParamOutput      = 2
 adParamReturnValue = 4
 adParamUnknown     = 0
+directions = {
+        0: 'Unknown',
+        1: 'Input',
+        2: 'Output',
+        3: 'InputOutput',
+        4: 'Return',
+    }
+def ado_direction_name(ado_dir):
+    try:
+        return 'adParam' + directions[ado_dir]
+    except:
+        return 'unknown direction ('+str(ado_dir)+')'
 
 # ObjectStateEnum
 adStateClosed     = 0
 def ado_type_name(ado_type):
     return adTypeNames.get(ado_type, 'unknown type ('+str(ado_type)+')')
 
+# here in decimal, sorted by value
+#adEmpty 0 Specifies no value (DBTYPE_EMPTY). 
+#adSmallInt 2 Indicates a two-byte signed integer (DBTYPE_I2). 
+#adInteger 3 Indicates a four-byte signed integer (DBTYPE_I4). 
+#adSingle 4 Indicates a single-precision floating-point value (DBTYPE_R4). 
+#adDouble 5 Indicates a double-precision floating-point value (DBTYPE_R8). 
+#adCurrency 6 Indicates a currency value (DBTYPE_CY). Currency is a fixed-point number with four digits to the right of the decimal point. It is stored in an eight-byte signed integer scaled by 10,000. 
+#adDate 7 Indicates a date value (DBTYPE_DATE). A date is stored as a double, the whole part of which is the number of days since December 30, 1899, and the fractional part of which is the fraction of a day. 
+#adBSTR 8 Indicates a null-terminated character string (Unicode) (DBTYPE_BSTR). 
+#adIDispatch 9 Indicates a pointer to an IDispatch interface on a COM object (DBTYPE_IDISPATCH). 
+#adError 10 Indicates a 32-bit error code (DBTYPE_ERROR). 
+#adBoolean 11 Indicates a boolean value (DBTYPE_BOOL). 
+#adVariant 12 Indicates an Automation Variant (DBTYPE_VARIANT). 
+#adIUnknown 13 Indicates a pointer to an IUnknown interface on a COM object (DBTYPE_IUNKNOWN). 
+#adDecimal 14 Indicates an exact numeric value with a fixed precision and scale (DBTYPE_DECIMAL). 
+#adTinyInt 16 Indicates a one-byte signed integer (DBTYPE_I1). 
+#adUnsignedTinyInt 17 Indicates a one-byte unsigned integer (DBTYPE_UI1). 
+#adUnsignedSmallInt 18 Indicates a two-byte unsigned integer (DBTYPE_UI2). 
+#adUnsignedInt 19 Indicates a four-byte unsigned integer (DBTYPE_UI4). 
+#adBigInt 20 Indicates an eight-byte signed integer (DBTYPE_I8). 
+#adUnsignedBigInt 21 Indicates an eight-byte unsigned integer (DBTYPE_UI8). 
+#adFileTime 64 Indicates a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (DBTYPE_FILETIME). 
+#adGUID 72 Indicates a globally unique identifier (GUID) (DBTYPE_GUID). 
+#adBinary 128 Indicates a binary value (DBTYPE_BYTES). 
+#adChar 129 Indicates a string value (DBTYPE_STR). 
+#adWChar 130 Indicates a null-terminated Unicode character string (DBTYPE_WSTR). 
+#adNumeric 131 Indicates an exact numeric value with a fixed precision and scale (DBTYPE_NUMERIC). adUserDefined 132 Indicates a user-defined variable (DBTYPE_UDT). 
+#adUserDefined 132 Indicates a user-defined variable (DBTYPE_UDT). 
+#adDBDate 133 Indicates a date value (yyyymmdd) (DBTYPE_DBDATE). 
+#adDBTime 134 Indicates a time value (hhmmss) (DBTYPE_DBTIME). 
+#adDBTimeStamp 135 Indicates a date/time stamp (yyyymmddhhmmss plus a fraction in billionths) (DBTYPE_DBTIMESTAMP). 
+#adChapter 136 Indicates a four-byte chapter value that identifies rows in a child rowset (DBTYPE_HCHAPTER). 
+#adPropVariant 138 Indicates an Automation PROPVARIANT (DBTYPE_PROP_VARIANT). 
+#adVarNumeric 139 Indicates a numeric value (Parameter object only). 
+#adVarChar 200 Indicates a string value (Parameter object only). 
+#adLongVarChar 201 Indicates a long string value (Parameter object only). 
+#adVarWChar 202 Indicates a null-terminated Unicode character string (Parameter object only). 
+#adLongVarWChar 203 Indicates a long null-terminated Unicode string value (Parameter object only). 
+#adVarBinary 204 Indicates a binary value (Parameter object only). 
+#adLongVarBinary 205 Indicates a long binary value (Parameter object only). 
+#adArray (Does not apply to ADOX.) 0x2000 A flag value, always combined with another data type constant, that indicates an array of that other data type.  
+
 # Error codes to names
 adoErrors= {
     0xe7b      :'adErrBoundToCommand',