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

Threaded View

  1. #1
    Join Date
    Dec 2009
    Posts
    596

    [RESOLVED] how to insert null date

    Hey everyone. I have some date fields that I want to not have any dates during a record creation. I figured the way to go would be to insert NULL. The way I'm going about it now gives me a Type mismatch error. How do I go about doing this? VB 2008 Standard/Access 2007

    Code:
      command.CommandText = "INSERT INTO IssueTbl(HardwareID,SoftwareID,Description,OpenedDate,AssignedDate,ClosedDate) " & _
               "VALUES('" & selHardware & "', " & _
               "'" & selSoftware & "', " & _
               "'" & Me.txtDescription.Text & "', " & _
               "'" & Now & "', " & _
               "'" & DBNull.Value & "', " & _
               "'" & DBNull.Value & "')"
    Last edited by viperbyte; November 24th, 2010 at 01:46 PM. Reason: Forgot to mention IDE and database

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