DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Date Format Error

  1. #1
    Join Date
    Aug 2002
    Posts
    176

    Date Format Error

    Hi all,

    I am using Visual Basic to Access an Oracle Database. I am using Oracle OLEDB Provider fro connectivity.
    The Table "Test" Looks like

    No Number(3)
    Do Date

    I issue the following command in Visual Basic
    De.con.execute "Insert into test Values(" & text1.text &",'" & text2.text &')"

    Value in text2= "12-dec-2002"
    Debug.print returns "Insert into test values(10,'12-dec-2002')"
    This works fine if i paste the above sql in Sqlplus but when executed from Visual basic the date is stored as "20-dec-0012" .

    Is there a problem with the driver ? Please Do advice

    Thanks
    Success Consists of Getting Up Just One More Time Than You've Fallen Down
    Be Blessed

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    I dont know why because I dont do VB stuffs, although myself I dont program a lot I do recommend you whenever you insert a date you should use to_date function to avoid implicit conversions since date format can vary from machine to machine (depending how´s your registry is defined)

  3. #3
    Join Date
    Aug 2002
    Posts
    176
    Thank you So much. Its Working Fine.
    Yesterday i tried to_date , but my stupidity i wrote the format in double quotes. Now itw working fine . Thanks .
    Success Consists of Getting Up Just One More Time Than You've Fallen Down
    Be Blessed

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