Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 334
  • Last Modified:

(VB DBF) Updating Blank Date in recordset

I need to know how to update a date in a FoxPro recordset to be blank. I keep receiving an error stating that the column is not-nullable. The option for Null values is set to 'Yes' in the connection. So, how can I assign a empty or null value to a field in a recordset??? I don't have any problem using an Access database, but for compatibility issues, I have to use dbf files.


Thanks in advance.


Miguel
0
msuarez
Asked:
msuarez
  • 3
1 Solution
 
aranaCommented:
try updating from an empty VARIANT variable, that may help you do what you what. or set your date to the "NULL DATE VALUE" wich i think it is jan-1-1899 or something like that (actually "1" is the integer value)
0
 
MelissaEvansCommented:
How are you attempting the update?  Are you setting the field to "" (a zero length string)?  Have you tried executing a SQL statement that specifically set it to null?  You said that the "option for Null values is set to 'Yes' in the connection."  Are you using ADO or DAO?  Is the Allow Null set in the table schema itself?  

Sorry 'bout bombarding you with more questions.
~Melissa
0
 
aranaCommented:
try using:

12 AM (Midnight) on 12/30/1899 (which actually is zero for the date data type.)
0
 
msuarezAuthor Commented:
Arana,

It worked just fine. Thank you.

But just out of curiosity. What happens if you have to use that specific date?



Miguel
0
 
aranaCommented:
well then it will be stored and retrieved as that specific date without problem.
(the problem comes when you try to use a date BEFORE that)

never tried, will be fun.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now