Detecting MEMO field

Discussion in 'ASP General' started by Lorenzo Bolognini, Sep 21, 2003.

  1. Hi all,

    i'd like to know if there is some way to detect whether a field is of type
    MEMO (i'm using MS Access) so to behave accordingly placing a textarea
    instead of a textbox in the UI.

    Thank You,
    Lorenzo
     
    Lorenzo Bolognini, Sep 21, 2003
    #1
    1. Advertising

  2. Lorenzo Bolognini

    PB4FUN Guest

    Assuming your Recorset is calle RS and you want to detect the first field
    use this :

    FS = RS.Fields(0).DefinedSize

    For a normal string value you will get a max of 255, where you have a larger
    value for a memo field (536870910)

    So after that you do this :

    If FS < 256 THEN
    'Code for textbox"
    ELSE IF FS > 500000000 THEN
    'code for textarea
    END IF

    Meindert, MCP

    "Lorenzo Bolognini" <> wrote in message
    news:eek:qnbb.97564$...
    > Hi all,
    >
    > i'd like to know if there is some way to detect whether a field is of type
    > MEMO (i'm using MS Access) so to behave accordingly placing a textarea
    > instead of a textbox in the UI.
    >
    > Thank You,
    > Lorenzo
    >
    >
     
    PB4FUN, Sep 21, 2003
    #2
    1. Advertising

  3. Lorenzo Bolognini

    Bob Barrows Guest

    Lorenzo Bolognini wrote:
    > Hi all,
    >
    > i'd like to know if there is some way to detect whether a field is of
    > type MEMO (i'm using MS Access) so to behave accordingly placing a
    > textarea instead of a textbox in the UI.
    >
    > Thank You,
    > Lorenzo


    The best way is to check the Field's Type property. If you go here:
    http://www.able-consulting.com/ADODataTypeEnum.htm, you will see the data
    mappings between the ADO datatype constants and the corresponding native
    datatypes for a few databases (including Access). So, if the Field's Type
    property contains 201 (adLongVarChar) or 203 (adLongVarWChar), then it's a
    Memo field.

    Bob Barrows
     
    Bob Barrows, Sep 21, 2003
    #3
  4. Thanks very much to both!

    Lorenzo
     
    Lorenzo Bolognini, Sep 22, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?TWF0dA==?=

    Update Access Memo field from ASP.NET

    =?Utf-8?B?TWF0dA==?=, Apr 11, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    5,991
    =?Utf-8?B?TWF0dA==?=
    Apr 11, 2005
  2. Hanno

    Display an Access Memo field in a GridView or DetailsView

    Hanno, Aug 4, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    267
    Ken Cox [Microsoft MVP]
    Aug 6, 2006
  3. David Lozzi

    Working with a Memo Field

    David Lozzi, Aug 1, 2003, in forum: ASP General
    Replies:
    2
    Views:
    99
    David Lozzi
    Aug 1, 2003
  4. Hate Spam

    ASP Paging on a searched memo field

    Hate Spam, Aug 5, 2003, in forum: ASP General
    Replies:
    2
    Views:
    152
    Michael D. Kersey
    Aug 9, 2003
  5. Jim Plante

    MS Access Memo Field and ASP

    Jim Plante, Aug 6, 2003, in forum: ASP General
    Replies:
    2
    Views:
    161
    MePadre
    Aug 6, 2003
Loading...

Share This Page