CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2001
    Posts
    33

    How to save date?

    I have a field which is used to store the date of birth of the user.
    It looks like "__/__/___"(dd/mm/yyyy) in the form. I used masked edit to do that.

    In the database I define the date of birth as type of datetime.
    How can I save the date ?
    i.e. rs("birthDate")=txtBirth ---> It doesn't work. Error generated

    Thx


  2. #2
    Join Date
    Jan 2000
    Location
    Saskatchewan, Canada
    Posts
    595

    Re: How to save date?

    How about this.
    rs("birthDate")= cdate(txtBirth)


    David Paulson

  3. #3
    Join Date
    Feb 2001
    Posts
    33

    Re: How to save date?

    It doesn't work !!!
    Error : Type Mismatch


  4. #4
    Join Date
    Mar 2001
    Posts
    2

    Re: How to save date?

    try this :

    rs!bdate=format(maskedit1.text,"mm/dd/yyyy")


  5. #5
    Join Date
    Feb 2001
    Posts
    33

    Re: How to save date?

    I've tried, but error generated : It said "Overflow " why?
    How to solve this ?
    Also , I would like to know how can I write a Insert statement for inserting a null date into the table ?



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

Featured