"vovan" <v@v.com>'s wild thoughts were released on Tue, 3
Jun 2008 10:40:48 -0400 bearing the following fruit:
>This statement is executed in SQL Query Analyzer with no problem:
>UPDATE [Partial] SET InvoiceDate = null WHERE PartialID = 34855
>
>I would like to run ADO command with that text. It fails. What should I use
>instead of null in the CommandText string?
Should work as it is. Do you get any error message?
Perhaps you should post the code.
--
Jan Hyde
https://mvp.support.microsoft.com/profile/Jan.Hyde
vovan - 03 Jun 2008 16:35 GMT
Thank you very much.
Yes, it really works. It did not work because I modified the string:
strUpdateSQL = "UPDATE [Partial] SET InvoiceDate = " &
datInvoiceDate & _
" WHERE PartialID = " & _
lngOrderPartialID
into
strUpdateSQL = "UPDATE [Partial] SET InvoiceDate = " & Null & _
" WHERE PartialID = " & _
lngOrderPartialID
And it did produce an error about wrong syntax. Now I moved Null inside:
strUpdateSQL = "UPDATE [Partial] SET InvoiceDate = Null " & _
" WHERE PartialID = " & _
lngOrderPartialID
and it works
vovan
> "vovan" <v@v.com>'s wild thoughts were released on Tue, 3
> Jun 2008 10:40:48 -0400 bearing the following fruit:
[quoted text clipped - 13 lines]
>
> https://mvp.support.microsoft.com/profile/Jan.Hyde
Saga - 03 Jun 2008 16:57 GMT
Fantastic! :-D
Saga

Signature
> Thank you very much.
> Yes, it really works. It did not work because I modified the string:
[quoted text clipped - 29 lines]
>>
>> https://mvp.support.microsoft.com/profile/Jan.Hyde
Fails in what way? Let's see the code.

Signature
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
> This statement is executed in SQL Query Analyzer with no problem:
> UPDATE [Partial] SET InvoiceDate = null WHERE PartialID = 34855
[quoted text clipped - 4 lines]
> Thank you
> vovan