Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
PDF export: text and vector shapes
Index Xtra
Special Edition Using Macromedia Director 8.5
MelixDB Xtra version 1.0 released.
Create Install
Check QuickTime Version
Complete Idiots Guide to Macromedia Flash 5
Set Screen Size
Director Developer Hosting
Mac Drive
 

 

 

Behavior Show Recordset's Current Record

Added on 4/7/2001

 

Compatibilities:
D7 D8 PC Script Shockwave

Required Xtras:
ADOXtra

This item has not yet been rated

Author: Eugene Shoustrov (website)

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

Send e-mail