Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Date field to NULL using rdoQuery

Posted on 1997-12-17
4
Medium Priority
?
269 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 400 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

650 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