Solved

Record update problem

Posted on 1999-01-22
7
137 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

758 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

13 Experts available now in Live!

Get 1:1 Help Now