Solved

Date field to NULL using rdoQuery

Posted on 1997-12-17
4
259 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
  • 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
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.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now