Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Zero length strings

    Hi All,

    What is the best way to handle zero length variables when inserting data
    into a table. I have text field and date fields, both of which have no data
    in them from time to time.

    I have been using this for the text fields.

    If myData="" then myData=" "

    I have used the same for dates.

    Is this OK to use or is there a better way.


    Thanks in advance,

    Bill.


    William E Hatto Guest

  2. Similar Questions and Discussions

    1. Length cannot be less than zero. Parameter name: length
      I receive the following error when I try to run this asp.net 1.1 app: Length cannot be less than zero. Parameter name: length Description: An...
    2. loadvariables get length
      How can I get the length of the amount of data that a php script has pushed as a result of a loadvariables?
    3. Column only a certain length?
      I want to have columns only be certain lengths, but if it goes over the length it will put "..." at the end. how do I do that? <td width="60px">...
    4. Extracting strings delimited by other strings
      Hi, I need to write some code that will allowed embedded, specially formatted comments to document test cases within a program (SAS code). The...
    5. How to get length of string? length() problems
      Simplified a bit, I'm parsing HTML documents to get sentences e.g. my $html = get($URL); # remove all HTML TAGs...blah blah blah @sentences =...
  3. #2

    Default Re: Zero length strings

    William E Hatto wrote on 13 jun 2004 in
    microsoft.public.inetserver.asp.db:
    > What is the best way to handle zero length variables when inserting
    > data into a table. I have text field and date fields, both of which
    > have no data in them from time to time.
    >
    > I have been using this for the text fields.
    >
    > If myData="" then myData=" "
    >
    > I have used the same for dates.
    >
    > Is this OK to use or is there a better way.
    >
    A string text field can have an empty string

    A date field must be set to null or a valid date.

    [depending on the type of database engine?]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan. Guest

  4. #3

    Default Re: Zero length strings

    Thanks Evertjan,

    I am using an Access Database.
    I get an error if I try to insert a zero length string in to the database.
    Is there something I am missing?

    I have got around it so far using the code in my OP.

    Is threr a better way?

    Cheers, Bill.


    "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
    news:Xns9507975A5B5A6eejj99@194.109.133.29...
    > William E Hatto wrote on 13 jun 2004 in
    > microsoft.public.inetserver.asp.db:
    >
    > > What is the best way to handle zero length variables when inserting
    > > data into a table. I have text field and date fields, both of which
    > > have no data in them from time to time.
    > >
    > > I have been using this for the text fields.
    > >
    > > If myData="" then myData=" "
    > >
    > > I have used the same for dates.
    > >
    > > Is this OK to use or is there a better way.
    > >
    >
    > A string text field can have an empty string
    >
    > A date field must be set to null or a valid date.
    >
    > [depending on the type of database engine?]
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)

    William E Hatto Guest

  5. #4

    Default Re: Zero length strings

    For Jet database Text fields, there as an Access-defined property called
    "Allow zero-length string" which you need to set in the table design view in
    Access.

    For Date/Time fields, you have to insert a Null, not a string.

    Bob Barrows

    William E Hatto wrote:
    > Thanks Evertjan,
    >
    > I am using an Access Database.
    > I get an error if I try to insert a zero length string in to the
    > database. Is there something I am missing?
    >
    > I have got around it so far using the code in my OP.
    >
    > Is threr a better way?
    >
    > Cheers, Bill.
    >
    >
    > "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
    > news:Xns9507975A5B5A6eejj99@194.109.133.29...
    >> William E Hatto wrote on 13 jun 2004 in
    >> microsoft.public.inetserver.asp.db:
    >>
    >>> What is the best way to handle zero length variables when inserting
    >>> data into a table. I have text field and date fields, both of which
    >>> have no data in them from time to time.
    >>>
    >>> I have been using this for the text fields.
    >>>
    >>> If myData="" then myData=" "
    >>>
    >>> I have used the same for dates.
    >>>
    >>> Is this OK to use or is there a better way.
    >>>
    >>
    >> A string text field can have an empty string
    >>
    >> A date field must be set to null or a valid date.
    >>
    >> [depending on the type of database engine?]
    >>
    >> --
    >> Evertjan.
    >> The Netherlands.
    >> (Please change the x'es to dots in my emailaddress)
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Barrows [MVP] Guest

  6. #5

    Default Re: Zero length strings

    Thankyou....


    "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
    news:eTP5H2UUEHA.3540@TK2MSFTNGP11.phx.gbl...
    > For Jet database Text fields, there as an Access-defined property called
    > "Allow zero-length string" which you need to set in the table design view
    in
    > Access.
    >
    > For Date/Time fields, you have to insert a Null, not a string.
    >
    > Bob Barrows
    >
    > William E Hatto wrote:
    > > Thanks Evertjan,
    > >
    > > I am using an Access Database.
    > > I get an error if I try to insert a zero length string in to the
    > > database. Is there something I am missing?
    > >
    > > I have got around it so far using the code in my OP.
    > >
    > > Is threr a better way?
    > >
    > > Cheers, Bill.
    > >
    > >
    > > "Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
    > > news:Xns9507975A5B5A6eejj99@194.109.133.29...
    > >> William E Hatto wrote on 13 jun 2004 in
    > >> microsoft.public.inetserver.asp.db:
    > >>
    > >>> What is the best way to handle zero length variables when inserting
    > >>> data into a table. I have text field and date fields, both of which
    > >>> have no data in them from time to time.
    > >>>
    > >>> I have been using this for the text fields.
    > >>>
    > >>> If myData="" then myData=" "
    > >>>
    > >>> I have used the same for dates.
    > >>>
    > >>> Is this OK to use or is there a better way.
    > >>>
    > >>
    > >> A string text field can have an empty string
    > >>
    > >> A date field must be set to null or a valid date.
    > >>
    > >> [depending on the type of database engine?]
    > >>
    > >> --
    > >> Evertjan.
    > >> The Netherlands.
    > >> (Please change the x'es to dots in my emailaddress)
    >
    > --
    > Microsoft MVP - ASP/ASP.NET
    > Please reply to the newsgroup. This email account is my spam trap so I
    > don't check it very often. If you must reply off-line, then remove the
    > "NO SPAM"
    >
    >

    William E Hatto Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139