access db date parameter error

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

  1. #1

    Default access db date parameter error

    Hello,
    I am using access database in aspx.
    I did something like this :
    ....
    currParam = new oleDbParameter("@create_date", OleDbType.DBTimeStamp)
    currParam.value = Now
    cmd.parameters.add(currParam)

    In the sql I wrote :
    insert into mytable ( ... , create_date , ....)
    values( ..., @create_date, ...)

    When execute the query I get an error :
    Data type mismatch in criteria expression.

    What is the problem ?

    Thanks :)



    Mr. x Guest

  2. Similar Questions and Discussions

    1. Custom Component - parameter access
      Hi, I am doing a demo for my own learning purposes, and I have a cutom MXML component that display XML data in grid format (not a repeater, but...
    2. Access date parameter problem
      I have been struggling with this for days. I am using a form to retrieve a list of dates and of store numbers. The user selects a date and store...
    3. Exception error with date/time (Access 2000)
      I am picking up a strange exception error for the following statement: If Rs.EOF OR DATEDIFF("d",rs("DateTime"),NOW()) Then '// End If Is...
    4. Date Parameter For Saved Parameter Queries
      Hi again, I finally got to using saved parameter queries in my application (a big thank you to Bob Barrows for helping me with this). Currently...
    5. #26207 [NEW]: date(): add format parameter for colons in UTC offset
      From: danielc at analysisandsolutions dot com Operating system: irrelevant PHP version: Irrelevant PHP Bug Type: ...
  3. #2

    Default Re: access db date parameter error

    "Mr. x" <a@b.com> wrote in message news:3f511bd6@news.012.net.il...
    > Hello,
    > I am using access database in aspx.
    > I did something like this :
    > ...
    > currParam = new oleDbParameter("@create_date",
    OleDbType.DBTimeStamp)
    > currParam.value = Now
    > cmd.parameters.add(currParam)
    <snip>
    Format your currParam using the proper identifier (mind the wrap):

    currParam.value="#" & FormatDateTime(Now) & "#"

    HTH
    Robert


    Frogbčrt 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