?
Solved

Date field to NULL using rdoQuery

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

764 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