Click to See Complete Forum and Search --> : How To Use NULL Date Field When Calling Stored Procedure with ADO


February 14th, 2000, 02:15 PM
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.

Lothar Haensler
February 15th, 2000, 03:48 AM
use datatype "Variant" instead of "Datetime".
That will allow you to assign NULL.

jemis7
February 16th, 2000, 12:13 PM
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 ?