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

    insert statement with dates

    If I have a table called events with two fields: id and date, where id is a number and date (is a general date) and has an input mask that looks like '99/99/00;0;_ , how can I insert a record into the table using SQL?
    i.e. shouldn't the following work:

    Dim Conn As New ADODB.Connection
    Conn.Open "dsn=dsRef"
    Conn.Execute ("insert into events (id, date) values (8, #01/01/00#)")
    -----------
    My error is 'syntax error in INSERT INTO statement'. Maybe I am overlooking something obvious? Any insight would be appreciated!

    Much thanks,
    msl


  2. #2
    Join Date
    Feb 2000
    Posts
    137

    Re: insert statement with dates

    Use the following:
    Conn.Execute ("insert into events (id, date) values (8, '01/01/00')")




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