Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Database Access / June 2008



Tip: Looking for answers? Try searching our database.

translate statement

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vovan - 03 Jun 2008 15:40 GMT
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?

Thank you
vovan
Jan Hyde (VB MVP) - 03 Jun 2008 15:48 GMT
"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
William Vaughn [MVP] - 03 Jun 2008 21:26 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.