Solved

Date field to NULL using rdoQuery

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sqlquerystress - To test db performance 8 42
Sql server function help 15 31
CPU high usage when update statistics 2 30
MS SQL Server COnditional Where statement 7 64
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

831 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