CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How to insert a date field in oracle table

    I am using VB5 and oracle as backend I want to insert a date value in a date field of a table. what insert statement shoud i use??
    i tried number of permutations.
    e.g.
    sqlstr = "insert into customerqry(cid,Billing_End_Date) values(1, " & Format("20/11/1999", "short date") & ")"
    it is giving me errror.
    please anyone help me. it is a bit urgent.

    thyanx in advance


  2. #2
    Join Date
    Jun 1999
    Posts
    42

    Re: How to insert a date field in oracle table

    What I do to insert a date into Oracle is like the example

    Global Q as String
    Global Conn as new ADODB.Connection
    Global Qenter as String

    Public Sub Oracle ()
    Qenter = chr(10)

    Q = "INSERT INTO XXXXX"
    Q = Q & "VALUES (TO_DATE('" & txtdate & "','mm/dd/yyyy'))
    Conn.Execute Q

    End Sub

    I hope this helps you


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