Script outputs the detailed information about the contents of the current record of a Recordset object.
-- Coded by Eugene Shoustrov
-- author@adoxtra.com
-- Shows the detailed info about the current record
-- rst is ADOxtra wrapper object of ADODB.Recordset
on ShowRecord rst
if rst.state=0 then
put "Recordset is closed."
else if rst.bof or rst.eof then
put "Current record does not exist."
else
repeat with i=0 to rst.Fields.Count-1
desc=""
desc=desc&&GetTypeName(rst.Fields[i].type)
attributes=rst.Fields[i].Attributes
if CheckBit(attributes,rst.adFldIsNullable) then
desc=desc&&"Nullable"
end if
if CheckBit(attributes,rst.adFldMayBeNull) then
desc=desc&&"MayBeNull"
end if
if CheckBit(attributes,rst.adFldRowID) then
desc=desc&&"RowId"
end if
if CheckBit(attributes,rst.adFldUpdatable) then
desc=desc&&"Updatable"
else
desc=desc&&"Readonly"
end if
name=rst.Fields[i].Name
val=rst.Fields[i]
put name&&"="&"E&val"E&desc
end repeat
end if
end
-- Handler returns the string description of the type
-- returned by the type property of ADO objects
on GetTypeName type
case type of
11: return "boolean"
8,129,203,202,200,130: return "string"
6: return "currency"
7: return "date"
14,131,139: return "numeric"
5,4: return "float"
0: return "empty"
3,2,16,19,18,17: return "integer"
72: return "GUID"
132: return "user-defined"
204: return "binary"
otherwise: return "unknown:"type
end case
end
-- Handler returns true if all bits in bitMask
-- are set in val
on CheckBit val, bitMask
return BitAnd(val,bitMask)=bitMask
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA