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
Solved

Record update problem

Posted on 1999-01-22
7
141 Views
Last Modified: 2010-05-03
I am connecting to an oracle database thru VB. One of the fields I am working with is a date field. If the date field already has a date in it, and I delete the date, and then update the record, I get an error, rather than the date being 'erased'. Any suggestions as to why this is happening would be appreciated.~~~~Crit
0
Comment
Question by:Crit
7 Comments
 
LVL 10

Expert Comment

by:caraf_g
ID: 1470081
Crit,

Maybe the date field was defined as "NOT NULL" in your database?

In that case it cannot be empty.
0
 

Author Comment

by:Crit
ID: 1470082
caraf_g,
I just checked the database, and that is not the case. I can, through, SQL Plus update the date to an empty string, just not through VB
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 1470083
Can you show me the line of code that's causing the problem?
0
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.

 
LVL 1

Expert Comment

by:ZenMaster
ID: 1470084
Have you tried to send a 00/00/00 value to the field being deleted?
0
 
LVL 3

Expert Comment

by:jjmartin
ID: 1470085
What is the exact error message you are getting?  Perhaps you are trying to fill the field with invalid data such as slashes from an input mask, but no date?
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 100 total points
ID: 1470086
Seen quite a bit of discussion on this in the VBData list I subscribe to. Seems that you *CAN'T* leave clear a date field to a blank. The conversion from Date data type does not allow for *no* value, everything will evaluate to *some* date. 0/0/00 doesn't work because it's not a valid date. The only solution that I've seen is to set it to some *bizzarre* date well out of range and use that as a "no date" value. Your display code will then need some logic to detect the out of range value and display something meaningful. Problem comes when you're dealing with people's birthdates and two digit years. Since it's not all that uncommon for people to live for 100 years or more you're going to get painted into a corner where there is *NO* valid "no date" value with a two digit year. (sigh).

Only way out is to recast the database and change the field type from Date to Text and then you can place in null values. *BUT* downside is that you lose the inherent validation and system location independence that DATE provides.

M

0
 

Author Comment

by:Crit
ID: 1470087
thanx for your help...........I'll let my boss sweat the rest!
Crit
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

856 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