Solved

Date field to NULL using rdoQuery

Posted on 1997-12-17
4
267 Views
Last Modified: 2009-07-29
How can I set a date field in a table to 'NULL' using the rdoQuery object? If I set the rdoParameter value to NULL I get an error!
0
Comment
Question by:roywijmans
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Jim_SQL
ID: 1089719
Hi,

I don't know the answer to your question since I've never worked with RDO, but... I would try one (all) of the following:

- if you pass a query then use the 'null' word (doesn't sound likely)
- if it is a property of an object, try setting it to 'nothing' in VB or else the equivilent in your language
- otherwise... set it to the standard 'null' value of datetimes (I think it's Jan 01 1790 or something)
- or... is it possible that the field doesn't allow nulls (so you need to use Jan 01 if you can't re-create your table to allow nulls)

(Hope this helped, I'd send this as a comment, but if its right I don't think I'd get points...?)
Jim
0
 

Author Comment

by:roywijmans
ID: 1089720
I use Visual Basic 5 and simply setting the rdoParameter to NULL doesn't work. What I want is just setting the field to NULL and the field does allow null values
0
 
LVL 9

Accepted Solution

by:
cymbolic earned 200 total points
ID: 1089721
Try the string value of Null.  This is interpreted on the server as a null in the database when used in Insert statements.  Also, in some instances, such as importing from text files, a blank field is also interpreted as a null on the server when defined as datetime.  Another setting may be a zero length string "". One of these has to work, or it can't be done!

The only other way around it would be to use a separate query where you encounter a missing (or null) date.
0
 

Author Comment

by:roywijmans
ID: 1089722
I made a mistake, I can update using rdoQuery but not with the connection designer! If I execute a store-proc like a method.


0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question