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

    How To Use NULL Date Field When Calling Stored Procedure with ADO

    Hello,

    I am trying to call a stored procedure with ADO. For some of the parameters for this procedure, I wish to use DATETIME. My problem occurs when I want to pass a NULL value. When I set theCmd.Parameters.Item("Date").Value = NULL, I later get the following error from the err object. [Microsoft][ODBC SQL Server Driver]Syntax error converting DATETIME from character string. The table in the database allows nulls, but I can seem to add one with VB. Please help me figure out what is wrong.

    Thanks.




  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: How To Use NULL Date Field When Calling Stored Procedure with ADO

    use datatype "Variant" instead of "Datetime".
    That will allow you to assign NULL.


  3. #3
    Join Date
    Feb 2000
    Posts
    5

    Re: How To Use NULL Date Field When Calling Stored Procedure with ADO

    Well, I would like to get some help on the stored procedures....can u please tell me how to do it ?
    Can it just be done with sql-server ?


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