Results 1 to 10 of 10

Thread: Easiest .asp question ever..... probably

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    I know this is easy but it's really driving me crazy.

    I am trying to log the time and date a form is being submitted into a database along with all of the information on the form. I don't want the person filling out the form to be able to change the time and date which is why I have it done like this...

    Code:
    ...
    <td>Opened Date&nbsp;</td>
    <td><%= Date%></td>
    </tr>
    <tr>
    <td>Opened Time&nbsp;</td>
    <td><%= Time%></td>
    </tr>
    ...
    This part is working fine. But when I'm trying to save it to a database it's not saving the time, but is saving the date. Here is my code I'm using for that.

    Code:
    ...
    rst("OpenedDate") = Date
    rst("OpnedTime") = Time
    ...
    I know it's not pulling that from the form but if it's a minute or two off it won't really matter. The date is populating but the time isn't.

    Please help. Thanks
    If you think education is expensive, try ignorance.

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    You have rst("OpnedTime")...try rst("OpenedTime").
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323

    sorry

    I'm sorry. This was retyped while I was posting this. the actual page does have opened on it, not opned.
    If you think education is expensive, try ignorance.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    That's okay. How about your field definitions? Are they compatible with setting the time?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323

    PERFECT!

    Thank you very much. That was it. The Date was set right, but Time was set to TEXT. Thanks again.
    If you think education is expensive, try ignorance.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323

    Sorry again

    It seems I have jumped to an incorrect conclusion. It still isn't working. The form is right, the submit.asp is right. I am stumped.... again.
    If you think education is expensive, try ignorance.

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    If it is not absolutely necessary to have them as searchable date/time values, use text fields and convert the date/time into a string using the Format function. Other than that, I'd have to see some of your code.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323
    I'm sorry but I don't really know what you mean by the format function. If you could expand a little more I'd appreciate it.

    Here is some of my code....
    default.asp-
    Code:
    <form action="submit.asp" method="post">
    Date Opened:&nbsp;<%= Date%><br>
    Time Opened:&nbsp;<%= Time%><br>
    <input type="submit" value="Submit">
    </form>
    submit.asp-
    Code:
    Dim cnn
    Dim rst
    Dim ConnectString
    ...
    ...
    rst.Addnew
    rst("OpenedDate") = Date
    rst("OpenedTime") = Time
    rst.Update
    rst.Movenext
    rst.Close
    I'm not sure if this is going to help you, but that's about what I've got.
    If you think education is expensive, try ignorance.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    323

    That was easy....

    Sorry but noone here had a chance at this one. Once looking it over with a new pair of eyes it seems the code was written 2x like this...

    Code:
    rst.addnew
    rst("OpenedDate") = Date
    rst("OpenedTime") = Time
    ...
    rst("OpenedTime") = Request.Form("OpenedTime")
    ...
    I'm sorry to waste your time. Thanks for the help though.
    If you think education is expensive, try ignorance.

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Don't worry...I don't have any time to waste .
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

Posting Permissions

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



Click Here to Expand Forum to Full Width