OLD ASP ... how to set a ADO param to Null

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

  1. #1

    Default OLD ASP ... how to set a ADO param to Null

    I am doing a loop in which the Date field is sometimes
    null

    How do I update a Stored Proc parameter to null

    I am looking for something like:

    Cmd.Parameter("@NewDate").value = null

    Thanks in advance,

    Stewart Rogers
    Stewart Rogers Guest

  2. Similar Questions and Discussions

    1. JSP tag <mm:param>
      In Tomcat 5.5 , open this jsp page , I can't see " Hi brandon". So what's wrong ? Thanks. urldemo.jsp: <% session.setAttribute("username",...
    2. cf param
      I am getting the error message."The required parameter FORM.UserName was not provided." I am providing a username, but it keeps giving me an this...
    3. .net client + Axis 1.1 server + wrapped param: null result
      I have used the following settings in our web services: .net framework 1.1 web services client Axis 1.1 server (in wsdd file, set...
    4. url and param in php
      "Ian.H " <[email protected]> ha scritto nel messaggio news:[email protected].. Php function list Sorry, but...
    5. Error: ?null? is null or not an object
      eloine: That is a bogus error message in that it probably refers to something you have done (or not done) on the page. So, looking in the...
  3. #2

    Default Re: OLD ASP ... how to set a ADO param to Null

    You can just leave the field out, without setting it to anything. The
    following article might answer your question:

    [url]http://www.vbrad.com/source/src_null_params_sp.htm[/url]

    --
    Manohar Kamath
    Editor, .netWire
    [url]www.dotnetwire.com[/url]


    "Stewart Rogers" <[email protected]> wrote in message
    news:1c5cb01c4527f$d5ebc860$[email protected]..
    > I am doing a loop in which the Date field is sometimes
    > null
    >
    > How do I update a Stored Proc parameter to null
    >
    > I am looking for something like:
    >
    > Cmd.Parameter("@NewDate").value = null
    >
    > Thanks in advance,
    >
    > Stewart Rogers

    Manohar Kamath [MVP] Guest

  4. #3

    Default Re: OLD ASP ... how to set a ADO param to Null

    Stewart Rogers wrote:
    > I am doing a loop in which the Date field is sometimes
    > null
    >
    > How do I update a Stored Proc parameter to null
    >
    > I am looking for something like:
    >
    > Cmd.Parameter("@NewDate").value = null
    >
    If you are not using a variable, then you don't have to do anything.

    if <date supplied> then
    Cmd.Parameter("@NewDate").value = #6/15/2004#
    End if

    However, if you are doing something like this:

    Cmd.Parameter("@NewDate").value = datevariable

    Then you need to set datevariable to null before setting the parameter
    value:

    if <no date supplied> then
    datevariable = null
    End if
    Cmd.Parameter("@NewDate").value = datevariable

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.


    Bob Barrows [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may not 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